From d148ccbcf4cf589abf09ad9c17ed288228444f74 Mon Sep 17 00:00:00 2001 From: David Irvine Date: Fri, 20 Oct 2017 19:39:28 -0500 Subject: [PATCH] Simplify code --- websocketproxy.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/websocketproxy.go b/websocketproxy.go index 3541716..e6fc4b0 100644 --- a/websocketproxy.go +++ b/websocketproxy.go @@ -48,11 +48,7 @@ type WebsocketProxy struct { // ProxyHandler returns a new http.Handler interface that reverse proxies the // request to the given target. -func ProxyHandler(target *url.URL) http.Handler { - return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { - NewProxy(target).ServeHTTP(rw, req) - }) -} +func ProxyHandler(target *url.URL) http.Handler { return NewProxy(target) } // NewProxy returns a new Websocket reverse proxy that rewrites the // URL's to the scheme, host and base path provider in target.