-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
reverseproxy: Rewrite requests and responses for websocket over http2 #6567
Conversation
Very neat, nice work @WeidiDeng 💯 |
I'm not 100% sure but a regular HTTP/2 GET request should contain the new setting parameter as outlined in RFC8441 Section 3?
Tested via curl: curl --trace request.dump --trace-config http/2 https://example.com |
i'm not sure about curl debug dump. But I tested this with my Chrome and it works. The setting frame is send at the start of a new http2 connection, so it's sent regardless of the method client uses. Even without my patch, golang http2 sends the following settings: The output doesn't list all of them. |
Upstream merged in 9a51899. Waiting for the next release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this Weidi! Cool feature. I am not sure I 100% fully understand every line of this, but after a scan I don't see any red flags that stick out to me.
golang/x/net v0.32.0 is out. |
Is this a simple version bump which could be done in this PR or are there any side effects? |
It's in another pr. |
So this is ready to merge @WeidiDeng ? |
Yes @francislavoie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Weidi. Let's give it a shot!
I updated to latest |
See #6733 |
@JeDaYoshi try
|
I should check PRs/issues properly before commenting things.. My apologies. @WeidiDeng |
…#6567) * reverse proxy: rewrite requests and responses for websocket over http2 * delete protocol pseudo-header * modify cloned requests * set request variable to track if it's a h2 websocket * use request bodu * rewrite request body * use WebSocket instead of Websocket in the headers * use logger check for zap loggers * fix lint
Supports reverse proxying h2 websockets to backends. Fix 5565.
Requires upstream support, but can be tested with
xcaddy build reverse-proxy-h2-websocket --replace golang.org/x/net=github.com/WeidiDeng/net@websocket-http2