WebFaction
Community site: login 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 12 Oct '12, 16:18

Datamosh
1324
accept rate: 0%

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

(12 Oct '12, 17:12) bmeyer71 ♦♦

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

(02 Mar '13, 16:23) jarav

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.

permanent link

answered 24 Jan '13, 11:18

jsbit
111
accept rate: 0%

Thanks jsbit. I have been banging my head to wall. So based on your answer, you can't run socket.io on Webfaction unless you have a secondary IP?

permanent link

answered 21 Aug '13, 15:22

yamasnax
11
accept rate: 0%

WebFaction provides secondary IP addresses for free, so this shouldn't be an issue -- just open a support ticket and request one for your app.

Also, you "can" run Socket.IO on WebFaction with no extra work at all -- you just need to use long polling.

The secondary IP and external port access will enable all of Socket.IO's features, including WebSockets.

(21 Aug '13, 17:39) likebike

Really good to know. I will try!! Thanks likebike!

(21 Aug '13, 17:59) yamasnax
Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×67
×8

question asked: 12 Oct '12, 16:18

question was seen: 6,281 times

last updated: 21 Aug '13, 17:59

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM