|
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. Thanks! |
|
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. |
Maybe post the code you have a question about for others to review.
Will socket.io work with xhr-polling even if you don't have a secondary ip with an open port?