Socket.io

65 views
Skip to first unread message

Frederic Jacquemin

unread,
Dec 5, 2013, 2:00:42 PM12/5/13
to locomo...@googlegroups.com
Hi Guys,


I need a little on this :

here is my bare simple initializers/02_socketio.js :

var socketio = require('socket.io');
module.exports = function() {
console.dir(this.server);
this.io = socketio.listen(this.server);
this.io.sockets.on('connection', function (socket) {
console.log("WebSocket Connected");
socket.emit('test', { message : "feed thru socket.io" });
socket.on('console_debug', function (data) {console.log(data);});
});
}

but I keep getting the following 404 :
  1. Request URL:
  2. Request Method:
    GET
  3. Status Code:
    404 Not Found

any idea??

Anything to do in the Route.js file???


Thanks for the help
Frederic

Frederic Jacquemin

unread,
Dec 5, 2013, 5:19:37 PM12/5/13
to locomo...@googlegroups.com
Ok this works using another port : var socketio = require('socket.io').listen(3001);

isn't it possible to make it share port 80 with Express & capture SocketIO's requests?
Reply all
Reply to author
Forward
0 new messages