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 :
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 |
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:
Regards, ~Christopher S, WebFaction Support answered 06 Sep '13, 13:28 likebike 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
|