Error on server. The client is requesting web sockets correctly, but judging by the response from your server, he doesn’t understand at all that he is being approached for web sockets, so handheld is not implemented.
In the normal case (server can do web sockets), the response headers look something like this:
HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
( sec-websocket-accept will of course look somehow different)
If you have not yet configured any implementation of webboxes on the server, do it. Otherwise, show the server code with a separate question.
What is a handshake?
Web Socket is a separate protocol. Implemented far from everywhere (unlike the default http). Therefore, in order for a client to communicate via web sockets, it is necessary to understand that their server is able. And the handshake is a procedure in which the client and the server agree that they can do websockets (moreover, the same version, the standard is still quite young). That is, in the simplest case, something like this happens:
Option 1:
Client (by http): Hey, dude, can you do web sockets? If yes, come on through them.
Server: yeah, come on in a web socket mode.
Option 2:
Client (by http): Hey, dude, can you do web sockets? If yes, come on through them.
Server: mmm .. what? I’ll return it ok (code 200).
Client to user: He does not understand anything
In practice, everything is quite a bit more complicated, even with a hend-neck, a sec-websocket-accept mask is added to protect against cache poisoning .