Hello! I have a problem with socket.io, runs fine in localhost, but in webfaction i have error 502 in my client code.
Forcing long polling instead websockets seems to fix it.
asked Oct 12 '12 at 16:18
You have a 502 error because Webfaction's service relies on Nginx, which doesn't support HTTP 1.1, which is required to use websockets. Socket.io fails (502) initially and then goes back to long polling.
Webfaction will provide you with a secondary IP and an open port if you ask for it, this will allow you to connect directly to the node app without first going through nginx.
Remember to remove io.set 'transports', 'xhr-polling' from your code afterwards.
answered Jan 24 at 11:18