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

reverseproxy: Rewrite requests and responses for websocket over http2 #6567

Merged
merged 11 commits into from
Dec 6, 2024
Prev Previous commit
Next Next commit
delete protocol pseudo-header
  • Loading branch information
WeidiDeng committed Sep 10, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
mac-cain13 Mathijs Kadijk
commit 8eaa94b32262df4ef9b600b7c07ab7469e6437ac
1 change: 1 addition & 0 deletions modules/caddyhttp/reverseproxy/reverseproxy.go
Original file line number Diff line number Diff line change
@@ -403,6 +403,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht
// websocket over http2, assuming backend doesn't support this, the request will be modifided to http1.1 upgrade
// TODO: once we can reliably detect backend support this, it can be removed for those backends
if r.ProtoMajor == 2 && r.Method == http.MethodConnect && r.Header.Get(":protocol") != "" {
r.Header.Del(":protocol")
r.Method = http.MethodGet
r.Header.Set("Upgrade", r.Header.Get(":protocol"))
r.Header.Set("Connection", "Upgrade")
Loading