WebSocket
HTTP上の双方向通信モード
HTTP以外の用途とHTTPを1つの接続で共有したりしなかったりできる
HTTP上では ws: , HTTPS上では wss: のURI scheme を使う
HTTP/2以降ではHTTPと混在可能
RFC 6455 WebSocket Protocol
https://triple-underscore.github.io/RFC6455-ja.html
RFC 7936 登録手順の明確化 WebSocket サブプロトコル名レジストリの場合
https://tex2e.github.io/rfc-translater/html/rfc7936.html
RFC 8307 Well-Known URIs for the WebSocket Protocol
https://tex2e.github.io/rfc-translater/html/rfc8307.html (RFC 5785)
RFC 8441 Bootstraping WebSockets with HTTP/2
https://tex2e.github.io/rfc-translater/html/rfc8441.html
RFC 9220 Bootstraping WebSockets with HTTP/3
https://tex2e.github.io/rfc-translater/html/rfc9220.html
HTTP アップグレードメカニズム
RFC 6455
HTTP/1.1 RFC 7230 Section 6.7 → RFC 9110, 9112 ?
HTTP CONNECT
RFC 8441
HTTP/2 RFC 7540 Section 8.3 → RFC 9113 ?
HTTP/3 HTTP/2とほぼ同じ
HTML Living Standard WebSockets
https://triple-underscore.github.io/WebSocket-ja.html
ハンドシェイク
code:HTTP/1.1
C->S
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
S->C
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
Sec-WebSocket-Protocol: chat
HTTP/2
HTTP/3