WebFaction
Community site: login faq

I have followed some tutorials and built a chat application using nodejs,socket io and django which works fine locally. But, when i try to run this in my live site,hosted on webfaction, i see a 'handshake error'. I have installed nodejs using this tutorial -- http://www.ravelrumba.com/blog/how-to-install-node-js-on-webfaction/

on client :

$(document).ready(function(){
        var socket = io.connect('http://node.ananthvemana.webfactional.com');
        socket.on('connect',function(){
            console.log('connect');
        });});

on server :

var http = require('http'); var server = http.createServer().listen(30699,'127.0.0.1'); var io = require('socket.io').listen(server);

i get this error in the browser console on trying to connect:

GET http://node.username.webfactional.com/socket.io/1/?t=1378464435111 500 (Internal Server Error)

and a 'handshake error' error in node console

Kindly help

asked 06 Sep '13, 06:57

ananth
313
accept rate: 0%


To make full use of Socket.IO, you need to send your traffic directly to your application's port -- not through the HTTP frontend's port 80. By communicating directly with your app's port, you will be able to use WebSockets, and other more advanced communication methods than long-polling.

External access to your port is NOT enabled by default. You need to submit a support ticket and request that external access is enabled for your app's port. (Be sure to mention which app and port you are referring to when you create the support ticket.)

After you get external access working, you would use a connection line like this in your client code:

var socket = io.connect('http://node.ananthvemana.webfactional.com:30699/');

Regards,

~Christopher S, WebFaction Support

permanent link

answered 06 Sep '13, 13:28

likebike
3366
accept rate: 28%

Now the node app has external access,but it seems there is a problem with handshake process. I have commented out the block of code related to 'authorization/handshake' of client to node in app.js file and now the server error is gone and the GET call http://<ip_addr>:30699/socket.io/1/?t=1378536468310 is now successfull.I assume there is some problem in the handshake process. Any suggestions?

(07 Sep '13, 06:25) ananth
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:

×909
×67
×8

question asked: 06 Sep '13, 06:57

question was seen: 6,951 times

last updated: 07 Sep '13, 06:25

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