My Node.js application is running at URL http://www.example.com/myapp/.
I have configured a Socket.IO server (version 1.3.5) with a custom namespace. Here is an example code snippet:
var server = http.createServer(...);
var io = socketio(server);
io
.of('/a/b/c')
.on('connection', function (socket) {
socket.emit('update', {msg: '/a/b/c'});
});
I can't figure out how to connect to this service from the client. My guesses (none of these is working):
io.connect('http://www.example.com/myapp/a/b/c');
io.connect('http://www.example.com', {path: '/myapp/a/b/c'});
io.connect('', {path: '/myapp/a/b/c'});
io.connect('http://www.example.com/a/b/c', {path: '/myapp'});
io.connect('http://www.example.com', {path: '/myapp/socket.io/a/b/c'});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…