简体   繁体   中英

Socket.io server not working

I've got a Socket.io server that is not working (it shows the following error on Firebug and of course it doesn't any of its functions):

GET http://www.example.com:1618/socket.io/1/?t=1401400488401 400 Bad Request 35ms

Also, when I try to run the server, it outputs that:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: listen EADDRINUSE
 at errnoException (net.js:904:11)
 at Server._listen2 (net.js:1042:14)
 at listen (net.js:1064:10)
 at net.js:1146:9
 at asyncCallback (dns.js:68:16)
 at Object.onanswer [as oncomplete] (dns.js:121:9)

I am running it on Ubuntu 14.04

EADDRINUSE means that there is another process that is listening to the port you're using for socket.io. Try changing the port number for socket.io when listen() is called.

On ubuntu, you might need to run it with sudo:

sudo nodejs your_server.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM