login community faq

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:

1
GET http://mysite.com/socket.io/xhr-polling//1304563260398 undefined (undefined)

Everything else works, and I'm sure I setup the custom apps correctly and am using the assigned port 47556. I'm at a loss for what to do and heard that it may have something to do with nginx, but I'm not sure.

Any help would be massively appreciated since I've been at this for hours.

asked May 04 '11 at 21:55

gisborne's gravatar image

gisborne
85

edited May 04 '11 at 21:56


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!

answered May 04 '11 at 22:04

neeravk's gravatar image

neeravk ♦♦
14061311

Great, so my intuition was close. If I get the dedicated IP, will things just work or do I need to configure nginx?

(May 04 '11 at 22:12) gisborne gisborne's gravatar image

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.

(May 04 '11 at 22:18) neeravk ♦♦ neeravk's gravatar image

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.

(May 16 '12 at 02:39) neeravk ♦♦ neeravk's gravatar image

What kind of traffic is allowed on the opened port? It used to be allowed only the above mentioned HTTP 1.0, and now?

(May 16 '12 at 06:16) unstar unstar's gravatar image

Any kind of TCP and UDP traffic is allowed.

(May 16 '12 at 06:43) iliasr ♦♦ iliasr's gravatar image

Awesome! :)

(May 16 '12 at 07:19) unstar unstar's gravatar image
showing 5 of 6 show all
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×21
×8
×7

Asked: May 04 '11 at 21:55

Seen: 2,045 times

Last updated: May 16 '12 at 07:19

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited