Is it possible to run socket.io & restify on the same port like express & socket.io?
I did just like this but it didn't work
# server.coffee
restify = require 'restify'
socket = require 'socket.io'
server = restify.createServer()
io = socket.listen server
server.listen 1337
when I try to connect to socket.io:
GET http://localhost:1337/socket.io/socket.io.js 404 (Not Found)
As suggested here by @jtomasrl and @zacheryph, this worked for me:
var server = restify.createServer();
var io = socketio.listen(server.server); //Note server.server instead of just server
Since this is the first google hit for "restify socket.io" I'm posting a new answer. This works fine now as documented at http://restify.com/docs/home/#socketio
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With