WebFaction
Community site: login faq

Referencing Question: http://community.webfaction.com/questions/3448/using-websockets-with-a-nodejs-custom-app

I've recently had a dedicated IP assigned and opened up a port via a custom application to host a Socket.io application. Upon connecting to the server I'm seeing this trace to the log:

   info  - socket.io started
web.js listening on 49677
   debug - served static content /socket.io.js
   debug - client authorized
   info  - handshake authorized 17211920642050297951
   debug - setting request GET /socket.io/1/websocket/17211920642050297951
   debug - set heartbeat interval for client 17211920642050297951
   debug - client authorized for 
   debug - websocket writing 1::
   info  - transport end

Client Code:

window.socket = io.connect();

socket.on('connect', function() { socket.emit('foo', 'bar'); } );

Server Code:

var app = express.createServer();
app.listen(49677);
var io = require('socket.io').listen(app);
io.configure(
    function ()
    {
        io.set("polling duration", 10);
        io.enable('browser client minification');
        io.enable('browser client etag');
        io.enable('browser client gzip');
        io.set('log level', 3);
        io.set('transports', ['websocket']);
    }
);

Could anyone offer any guidance on how to get websockets working properly with a dedicated IP address on WebFaction? I've tried adding my server's ip and port into the client-side io.connect() call but the request doesn't receive a response.

Thanks!

asked 01 Mar '12, 15:56

Elliot
111
accept rate: 0%


Hi,

As described, everything should be working properly. Can you open a ticket, so we can look at the actual server and try to reproduce the problem?

permanent link

answered 02 Mar '12, 03:36

todork
1.2k5
accept rate: 34%

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:

×34
×5
×3

question asked: 01 Mar '12, 15:56

question was seen: 4,099 times

last updated: 02 Mar '12, 03:36

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 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