WebSocket 相關 Protocol
建立連線
GET /chat HTTP/1.1 Host: example.com:8000 Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Version: 13TTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=client-Sec-Websocket-Key = randomBytes(16).toString('base64')
發送 Data
持續發送 heartBeat 保持連線
結束連線
參考資料
Last updated