0

I have followed this tutorial: http://www.stephendiehl.com/?p=309 describing how to run a gevent pywsgi server serving Django with socketio behind a nginx front-end.

As this tutorial says, Nginx doesn't support websocket unless using a tcp proxy module. This proxy module doesn't support the use of the same port for socketio and classic serving, from what I understood the configuration look like that:

nginx listen on port 80

nginx tcp proxy listen on port 7000

Everything is forwarded to port 8000

Problem: the resulting socketio request doesn't include the django cookie containing the session id so I have no information on the requesting user in my django view.

I guess it's caused by the fact that the request is made to another port (7000) causing the browser to identify the request as cross-domain ?

What would be the cleanest way to include the django cookie into the request ?

Ivo
  • 5,378
  • 2
  • 18
  • 18
Ashe
  • 107
  • 1
  • 11

1 Answers1

1

Most answers in this question seem to indicate that port doesn't matter.

Also checked and supposedly WebSockets is regarded as HTTP, so HTTPOnly cookies should still be sent.

SocketIO seems to be using a custom Session manager to track users. Maybe try and link that up?

Community
  • 1
  • 1
Ivo
  • 5,378
  • 2
  • 18
  • 18
  • Hello, thanks for the answer. I do believe now that it's more about the protocol than the port (like you just said). I wasn't successful at linking the two session so I fall back to long polling. – Ashe Feb 07 '12 at 18:50