|
|
|
|
|
by gizmo
4529 days ago
|
|
I only looked at it for a second or so, but it looks like it's a simple json proxy. You put a webserver with persistent connections on one end (Tornado in the example code) and a regular django environment side by side. The web socket requests are translated in to GET/PUT/POST requests, are pushed to django, django responds and the response is pushed to the client. So from django's point of view there are stateless JSON requests and responses, so django's happy. The python proxy code is a lightweight wrapper that doesn't have to understand any business logic, so that's pretty straightforward as well. |
|
What are the advantages of this over normal AJAX requests, given that it's all using the single request, single response mode of operation (and you can compress/cache AJAX requests/responses, which websockets doesn't support yet).