Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement websocket boostrapping for http2 #1604

Closed

Conversation

ttaym
Copy link
Contributor

@ttaym ttaym commented Apr 8, 2022

Contributes to #755

  • HTTP/2 -> HTTP/1.1
  • HTTP/2 stream FSM amendments
  • Sec-WebSocket-Key insert
  • HTTP/1.1 -> HTTP/2
  • Sec-WebSocket-Accept strip
  • Pairing server connection to client stream
  • Websocket protocol amendments
  • Gracefull shutting down stream

This PR adds CONNECT method and :protocol header field for HTTP/2 parsing.

CONNECT HTTP/2 messages with :protocol equals to websocket transformed to HTTP/1.1 messages for backend with method GET, headers Connection: upgrade and Upgrade: websocket.

Responses from backend with headers Connection: upgrade, Upgrade: websocket and status 101 transformed to :status 200 HTTP/2 responses to client.

When sending 200-success to CONNECT request with websocket :protocol we need not to send END_STREAM frame flag. So to gracefully shutting down stream we need to detect Close websocket control frame or rely on closing tcp connection from backend or closing stream from client.

Note that Sec-WebSocket-Accept stripped from HTTP/1.1 responses and Sec-WebSocket-Key added to HTTP/1.1 request to backend.

Signed-off-by: Aleksey Mikhaylov [email protected]

@ttaym ttaym force-pushed the am-755-websocket-bootstrap-http2 branch 3 times, most recently from 52d61fe to ebebe5f Compare April 14, 2022 14:30
@ttaym ttaym force-pushed the am-755-websocket-proxy-proto branch 4 times, most recently from 73779c5 to 6ef6324 Compare April 21, 2022 13:56
@ttaym ttaym force-pushed the am-755-websocket-bootstrap-http2 branch from 29509ff to cec6066 Compare April 22, 2022 08:00
@ttaym ttaym changed the title Implemnt websocket boostrapping for http2 Implement websocket boostrapping for http2 Apr 22, 2022
@ttaym ttaym force-pushed the am-755-websocket-bootstrap-http2 branch from 171874b to 113b1f8 Compare April 22, 2022 08:16
@ttaym ttaym force-pushed the am-755-websocket-bootstrap-http2 branch from 4e75dec to 849a98c Compare April 22, 2022 14:01
@ttaym ttaym force-pushed the am-755-websocket-proxy-proto branch from 0d27705 to 147ef9a Compare April 22, 2022 14:03
@ttaym ttaym force-pushed the am-755-websocket-proxy-proto branch 3 times, most recently from 4057450 to ac84d06 Compare April 28, 2022 09:22
@ttaym ttaym force-pushed the am-755-websocket-proxy-proto branch from 67cdf28 to 6b4edba Compare May 5, 2022 12:24
@ttaym ttaym deleted the branch am-755-websocket-proxy-proto May 9, 2022 08:50
@ttaym ttaym closed this May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant