login community faq

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.
Is there a problem in my code or is a limitation of webfaction?

Thanks!

asked Oct 12 '12 at 16:18

Datamosh's gravatar image

Datamosh
32

Maybe post the code you have a question about for others to review.

(Oct 12 '12 at 17:12) bmeyer71 ♦♦ bmeyer71's gravatar image

Will socket.io work with xhr-polling even if you don't have a secondary ip with an open port?

(Mar 02 at 16:23) jarav jarav's gravatar image

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

jsbit's gravatar image

jsbit
1

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
×4

Asked: Oct 12 '12 at 16:18

Seen: 756 times

Last updated: Mar 02 at 16:23

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