-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work in cloud9 IDE #276
Comments
Remember the 0.7 API changed. Please consult the README. |
Hmmm.Is it meant what c9.io now has obsoleted version of the module and if so when it will be updated? |
Sorry, I also can not run socket.io on c9.io Any suggestions? /var/lib/stickshift/13881f8548e0437d85a9c9028dc08ec1/app-root/data/258575/node_modules/socket.io/lib/manager.js:104 |
What are you passing into the listen call? |
I tried this var io = require('socket.io').listen(process.env.PORT, process.env.IP); and just this var io = require('socket.io').listen(process.env.PORT); |
It looks like process.env.PORT is a Number object instead of a primitive. Socket.io probably shouldn't care, but give this a try. var io = require('socket.io').listen(process.env.PORT.valueOf()); |
Thank you for idea process.env.PORT is string. var io = require('socket.io').listen(process.env.PORT.valueOf()); But these works. var io = require('socket.io').listen(Number(process.env.PORT)); and var io = require('socket.io').listen(+process.env.PORT); |
+1 this was the same problem I encountered on Heroku. Also worth noting on heroku was that for SSL + WebSockets to work, I had to enable WebSocket support first, and then provision the SSL endpoint: https://devcenter.heroku.com/articles/heroku-labs-websockets |
I've installed socket module - npm install socket.io
When I create server simple like this:
var io = require('socket.io').listen(process.env.C9_PORT);
When I got this exception:
debugger listening on port 5860
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object 20002 has no method 'listeners'
at new Manager (/mnt/ws/users/baio/52249/node_modules/socket.io/lib/manager.js:85:30)
at Object.listen (/mnt/ws/users/baio/52249/node_modules/socket.io/lib/socket.io.js:70:10)
at Object. (/mnt/ws/users/baio/52249/websocket.server.js:1:93)
at Module._compile (module.js:404:26)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at Array. (module.js:423:10)
at EventEmitter._tickCallback (node.js:126:26)
The text was updated successfully, but these errors were encountered: