I've been struggling with a strange problem with my websocket connection. I use socketio 1.4.5 to connect to the server (flask, flask-socketio, gunicorn, nginx).
The problem is that about 1 of 8 connection attempts socketio connects using xhr polling after the websocket connection is established. Somehow this blocks the whole communication for this specific client. When timeout is reached (60seconds in my case) socketio connects again and if no xhr-polling is blocking the next time, the communication is up again.
This i very frustrating. and i have never seen this problem earlier on application with the same setup.
?EIO=3&transport=websocket&sid=997d6d19758641249e3b1232341e9fe2 GET 101 websocket localhost websocket Other 0 B 1.0 min
?EIO=3&transport=polling&t=LEUZRW7&sid=997d6d19758641249e3b1232341e9fe2 GET 504 http/1.1 localhost 127.0.0.1:443 xhr socket.io-1.4.5.js:1 763 B 1.0 min
The two lines above is what is available on the network tab when analyzing the trafic in chrome. Before the timeout is reached, 504 is replaced with "pending".
I have been trying to find the solution for this for a couple of hours now, and running out of ideas. I hope someone can help me with this..