Strange node js/socket io crash?

Well I have a game with its server running on node js, using socket io and mysql to store userdata. The problem is that my server crashed already twice, and all it gave me is the following:

[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m/root/node_modules/socket.io/lib/transports/jsonp-polling.js:88[0m
[36m[game.js][0m [31mthis.response.writeHead(200, {[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m^[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31mTypeError: Cannot call method 'writeHead' of undefined
at JSONPPolling.doWrite (/root/node_modules/socket.io/lib/transports/jsonp-polling.js:88:17)
at JSONPPolling.write (/root/node_modules/socket.io/lib/transports/http-polling.js:132:8)
at JSONPPolling.packet (/root/node_modules/socket.io/lib/transport.js:515:15)
at JSONPPolling.error (/root/node_modules/socket.io/lib/transport.js:498:8)
at JSONPPolling.onData (/root/node_modules/socket.io/lib/transports/jsonp-polling.js:69:10)
at IncomingMessage.<anonymous> (/root/node_modules/socket.io/lib/transports/http.js:65:12)
at IncomingMessage.emit (events.js:64:17)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:127:21)
at Socket.ondata (http.js:1468:22)
at TCP.onread (net.js:374:27)[0m

Socket io seems to have some problem with the head of a response, but how do I go about fixing this? And I havent tried anything yet btw (cause I really have no idea where to start)

I fixed it, it's a bug with the jsonpolling in socket.io, simply disable it with:

socket.set('transports', [ 'websocket', 'htmlfile', 'xhr-polling' ])

Now it works. Yay!