0

I'm working on a ubuntu 12.04 with python, django and recently django-socketio (https://github.com/stephenmcd/django-socketio). My problem is when I send something to the server through socket and wait for it to send back, when it doesn't. the django server is running on default http port(80). And the socketio on 8080 port. if I access my website like this: 'http://mysite.com/' the pages using socketio does not work at all. But using the 8080 port, everything works!

The reason I don't use the socketio server to handle requests(it has a server that you start by typing a manage.py command) is that I don't know how to do it using apache. Got stuck with setting up the wsgi file. What I know so far is that you have to attach the SocketIOServer to django application and whatever. Have tried this, with no success.

My question is: how can I make this work? Maybe having one handling on one port the other on other port should work. But also tried this.

I really don't want to use ajax since is lot's of async requests.

Something, please!

Thanks in advance.

Patrick Bassut
  • 3,310
  • 5
  • 31
  • 54
  • Can you post the error you see in Web Inspector/Firebug for the outgoing websocket? – Thomas Apr 01 '13 at 12:28
  • There's no error. It just don't work. – Patrick Bassut Apr 01 '13 at 15:04
  • Just help me think here. When I use the port 8080, it works just fine. But then when i switch back to 80(the port apache is listening to) the socket just sends information, it doesnt receive. – Patrick Bassut Apr 01 '13 at 16:05
  • So the thing to know here is that apache and mod_wsgi do not support passthrough of websockets. You need to point the websocket part of socket.io at port 8080 even while the static part is pointed at port 80. Have you set `SOCKETIO_HOST` and `SOCKETIO_PORT` in your settings.py? – Thomas Apr 02 '13 at 04:11
  • yes, i did. As I mentioned it works alright on 8080 port(that means the client knows which port to connect through the {% socketio_tags %} ). Do you think tornardIO would turn out another way? – Patrick Bassut Apr 02 '13 at 17:41

0 Answers0