Skip to content

Commit 424c31d

Browse files
authored
Merge pull request #13 from aviddiviner/master
Simplify code
2 parents 7338eea + d148ccb commit 424c31d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

websocketproxy.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ type WebsocketProxy struct {
4848

4949
// ProxyHandler returns a new http.Handler interface that reverse proxies the
5050
// request to the given target.
51-
func ProxyHandler(target *url.URL) http.Handler {
52-
return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
53-
NewProxy(target).ServeHTTP(rw, req)
54-
})
55-
}
51+
func ProxyHandler(target *url.URL) http.Handler { return NewProxy(target) }
5652

5753
// NewProxy returns a new Websocket reverse proxy that rewrites the
5854
// URL's to the scheme, host and base path provider in target.

0 commit comments

Comments
 (0)