draft-mcmanus-httpbis-h2-websockets

https://tools.ietf.org/html/draft-mcmanus-httpbis-h2-websockets-00#section-4.2

" [[ From Client ]]                        [[ From Server ]]
"
"                                           SETTINGS
"                                           ENABLE_CONNECT_PROTOCOL = 1
"
"  HEADERS + END_HEADERS
"  :method = CONNECT
"  :protocol = websocket
"  :scheme = wss
"  :path = /chat
"  :authority = server.example.com:443
"
"                                           HEADERS + END_HEADERS
"                                           :status = 200
"
"  DATA
"  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
"
"                                           DATA
"                                           HTTP/1.1 101 Plead The Fifth
"                                           Upgrade: websocket
"                                           Connection: Upgrade
"                                           Sec-WebSocket-Accept:
"                                            s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
"                                           Sec-WebSocket-Protocol: chat
"
"  DATA
"  WebSocket Data
"
"                                           DATA + END_STREAM
"                                           WebSocket Data
"
"  DATA + END_STREAM
"  WebSocket Data

I'm wondering

1) why this is is not

"                                           SETTINGS
"                                           ENABLE_CONNECT_PROTOCOL = 1
"
"  HEADERS + END_HEADERS
"  :method = CONNECT
"  :protocol = websocket
"  :scheme = wss
"  :path = /chat
"  :authority = server.example.com:443
"  sec-webSocket-key = dGhlIHNhbXBsZSBub25jZQ==
"  origin = http://example.com
"  sec-websocket-protocol = chat, superchat
"  sec-websocket-version = 13
"
"                                           HEADERS + END_HEADERS
"                                           :status = 200
"                                           sec-websocket-accept = s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
"                                           sec-websocket-protocol = chat
"
" DATA
" WebSocket Data
"
"
"                                           DATA + END_STREAM
"                                           WebSocket Data

2)

What happens if this is

" [[ From Client ]]                        [[ From Server ]]
"
"                                           SETTINGS
"                                           ENABLE_CONNECT_PROTOCOL = 1
"
"  HEADERS + END_HEADERS
"  :method = CONNECT
"  :protocol = websocket
"  :scheme = wss
"  :path = /chat
"  :authority = server.example.com:443
"
"                                           HEADERS + END_HEADERS
"                                           :status = 200
"

"  DATA
"  GET /admin HTTP/1.1
"  Host: server.example.org
"  Upgrade: websocket
"  Connection: Upgrade
"  Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
"  Origin: http://example.org
"  Sec-WebSocket-Protocol: chat, superchat
"  Sec-WebSocket-Version: 13

That is: "outer" (h2) and "inner" (websocket) handshake gives different data.

/ Kari Hurtta

Received on Tuesday, 17 October 2017 18:33:54 UTC