I've been attempting to get socket.io-client
to work with a socket.io
localhost server on the port 9000. Both the client and server are based in NodeJS.
This seems to connect to the server:
io = require('socket.io-client')
socket = io.connect('http://localhost:9000', {resource : 'node_modules/socket.io'})
socket.on 'connect', ->
socket.emit 'message', {hello: 'world'}
return
However it gives the following error:
self.transport.onClose();
^
TypeError: Cannot call method 'onClose' of null
The server appears to register the request properly:
GET /node_modules/socket.io/1/?t=1388048751499 200 11ms - 2.81kb
Is there a working example of a NodeJS-based client for Socket IO? Links found:
self.transport.onClose();
called? – mekwallsocket.io
orsocket.io-client
. Your are most definately doing something wrong. We need more code to be able to figure out what isn't working properly. – mekwall