|
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. |
|
Hi, 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! Great, so my intuition was close. If I get the dedicated IP, will things just work or do I need to configure nginx? You would just need to get any port(depending upon availability) opened on the dedicated IP and bind your server to that on the IP. You won't need to configure Nginx. Update: As of now, you don't need a dedicated IP to get ports opened. You can just request it in a support ticket and we can open it on a shared IP specifically added to servers for opening ports. What kind of traffic is allowed on the opened port? It used to be allowed only the above mentioned HTTP 1.0, and now? Any kind of TCP and UDP traffic is allowed. Awesome! :)
showing 5 of 6
show all
|