Created
October 13, 2011 18:59
-
-
Save ppcano/1285161 to your computer and use it in GitHub Desktop.
socket.io namespace error (Object #<SocketNamespace> has no method 'connect')
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cio = require("socket.io-client") | |
io = require("socket.io") | |
var manager = io.listen( port ); | |
manager.of('/chat').on('connection', function (socket) { | |
console.log('connecting socket on server'); | |
}); | |
var socket = cio.connect( 'http://localhost:'+port +'/chat' ); | |
socket.on('connect', function() { | |
console.log('connected client '); | |
}); | |
socket.connect( ); // this must be removed, it causes the error because it autoconnects |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment