socket.io: WebSocket connection to failed: Invalid frame header

WebSocket connection to 'ws://10.1.30.58/socket.io/?EIO=3&transport=websocket' failed: Invalid frame header

server debug:

 socket.io:server incoming connection with id 7hnvZ1RkTsCgjyVVAAB- +4ms
 socket.io:client connecting to namespace / +3ms
 socket.io:namespace adding socket to nsp / +1ms
 socket.io:server incoming connection with id gOcFr2YHNcmSF9hqAAB_ +2ms
 socket.io:client connecting to namespace / +2ms
 socket.io:namespace adding socket to nsp / +1ms
 socket.io:namespace next called after client was closed - ignoring socket +74m

 socket.io:namespace next called after client was closed - ignoring socket +2ms

 socket.io:namespace next called after client was closed - ignoring socket +1ms

 socket.io:namespace next called after client was closed - ignoring socket +2ms

 socket.io:namespace next called after client was closed - ignoring socket +2ms

 socket.io:namespace next called after client was closed - ignoring socket +1ms

On client side: var socket = io({transports: ['websocket']}); //socket.io

What’s wrong?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 28

Most upvoted comments

For me the answer was that I was connecting with a client that was version 2 and the server was running version 4. As per the docs I had to enable allowEIO3 on the server

Same issue, I only get the error in the chrome console

I used node-static for serving files, with it socket.io doesn’t work. With express or default node(http) it works.

Here an example: https://github.com/littleguga/websocket-test