We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cbab5f8 + 91e2dd1 commit f90542eCopy full SHA for f90542e
websocketproxy.go
@@ -52,7 +52,14 @@ func ProxyHandler(target *url.URL) http.Handler {
52
// NewProxy returns a new Websocket reverse proxy that rewrites the
53
// URL's to the scheme, host and base path provider in target.
54
func NewProxy(target *url.URL) *WebsocketProxy {
55
- backend := func(r *http.Request) *url.URL { return target }
+ backend := func(r *http.Request) *url.URL {
56
+ // Shallow copy
57
+ u := *target
58
+ u.Fragment = r.URL.Fragment
59
+ u.Path = r.URL.Path
60
+ u.RawQuery = r.URL.RawQuery
61
+ return &u
62
+ }
63
return &WebsocketProxy{Backend: backend}
64
}
65
0 commit comments