What is Sec-WebSocket-Key for?

后端 未结 5 2140
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 01:32

In section 1.3 \"Opening Handshake\" of draft-ietf-hybi-thewebsocketprotocol-17, it describes Sec-WebSocket-Key as follows:

To prove that the

5条回答
  •  伪装坚强ぢ
    2021-02-01 01:59

    The RFC 6455 spec shows the (minimum) 4 lines that the server needs to respond to the client (browser) with. The hardest part is confirming your Websocket server C code is doing the right calculations. Here's a short PHP script (PHP is easy to install on all OS's) that will properly calculate the key to reply with. Hard-code the key you get from the client (browser) into the 2nd line below:

    
    

提交回复
热议问题