Implementing Websocket Handshake
Introduction Welcome to the second post of the reinventing the wheel - websocket series. In this article, I intend to cover websocket handshake in detail and implement it in golang. Before continuing, it is recommended to go through the introductory post here Client Handshake In the previous article, we saw that the client handshake request looked like this. GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 13 It is a standard HTTP upgrade request with a few additional headers. ...