最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Unrecognized frame opcode: 5 and web socket closes - Stack Overflow

matteradmin4PV0评论

I get this error very often in my web socket application and web socket immediately closes. The only error message I see is "Unrecognized frame opcode: 5 " in my browser console. Can anyone give me an idea why and in which case this error occurs.

Thanks!

I get this error very often in my web socket application and web socket immediately closes. The only error message I see is "Unrecognized frame opcode: 5 " in my browser console. Can anyone give me an idea why and in which case this error occurs.

Thanks!

Share Improve this question edited Sep 25, 2012 at 12:58 pmfl asked Sep 25, 2012 at 12:51 pmflpmfl 2,1095 gold badges31 silver badges48 bronze badges 2
  • This is not a jQuery-specific question. – user659025 Commented Sep 25, 2012 at 12:57
  • Can you post client code that demonstrates this please? Also, which server are you using? If its not a standard server, can you also post source for it? – simonc Commented Sep 25, 2012 at 13:00
Add a ment  | 

1 Answer 1

Reset to default 2

The final draft of the WebSocket RFC 6455 defines opcodes 0, 1, 8, 9 and 10. Old versions (e.g. version 6) have defined opcode 5 to be a binary frame. This is now obsoleted, that opcode no longer exists.

Your server is outdated and only supports old versions of the WebSocket protocol. Many WebSocket servers support multiple versions and are able to switch between them. You should use a server that does that.

Post a comment

comment list (0)

  1. No comments so far