So I've built a Node.Js (version 0.4.7) application using Express (version 2.3.3) and Socket.io (version 0.6.17) for websockets. Everything works fine on my local machine with the same setup, but when I set it up on my server the socket on the client side is unable to communicate with the server. More specifically I get this error as it tries to use each transport method unsuccessfully:
Everything else works, and I'm sure I setup the custom apps correctly and am using the assigned port
Any help would be massively appreciated since I've been at this for hours.
Websockets require a keepalive connection which is not possible through Nginx as it only supports HTTP 1.0 connections to the backend.
So, to use Websockets you need to bypass nginx which can only be done if you have a dedicated IP and get the port where your app is listening is opened by us for incoming connections.
You can apply for a dedicated IP here(it costs $5/month): https://my.webfaction.com/upgrades
Hope that helps!
answered 04 May '11, 22:04