Node.js (with socket.io and express) throw "events.js: 71 throw arguments [1]; // Unhandled 'error' event"

I start the express (via nginx proxy) using socket.io and after a few moments (the application works fine for some time) console throw this:

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: socket hang up
    at createHangUpError (http.js:1360:15)
    at ServerResponse.OutgoingMessage._writeRaw (http.js:507:26)
    at ServerResponse.OutgoingMessage._send (http.js:476:15)
    at ServerResponse.OutgoingMessage.write (http.js:749:16)
    at XHRPolling.doWrite (/home/xyz/chat/node_modules/socket.io/lib/transports/xhr-polling.js:67:17)
    at XHRPolling.HTTPPolling.write (/home/xyz/chat/node_modules/socket.io/lib/transports/http-polling.js:132:8)
    at XHRPolling.Transport.onDispatch (/home/xyz/chat/node_modules/socket.io/lib/transport.js:222:10)
    at Socket.dispatch (/home/xyz/chat/node_modules/socket.io/lib/socket.js:230:38)
    at Socket.packet (/home/xyz/chat/node_modules/socket.io/lib/socket.js:214:10)
    at Socket.emit (/home/xyz/chat/node_modules/socket.io/lib/socket.js:368:15)

Any ideas?

+5
source share
1 answer

If you are using node.js version 0.8.20, then this error has been observed by many, including me.

https://github.com/LearnBoost/socket.io/issues/1160

Updating node.js to version 0.8.21 solves this problem.

+1
source

All Articles