Skip to content
Permalink
Browse files

Fix path duplication

  • Loading branch information...
antoniomika committed Mar 29, 2019
1 parent c849006 commit 3fb7d4aad6fc3583554e96b2f2dabd3fd7e53e75
Showing with 13 additions and 12 deletions.
  1. +13 −12 http.go
25 http.go
@@ -54,8 +54,9 @@ func startHTTPHandler(state *State) {

proxyHolder := loc.(*ProxyHolder)

url := c.Request.URL
url := *c.Request.URL
url.Host = "local"
url.Path = ""
url.Scheme = proxyHolder.Scheme

dialer := func(network, addr string) (net.Conn, error) {
@@ -69,7 +70,7 @@ func startHTTPHandler(state *State) {
}

url.Scheme = scheme
wsProxy := websocketproxy.NewProxy(url)
wsProxy := websocketproxy.NewProxy(&url)
wsProxy.Dialer = &websocket.Dialer{
NetDial: dialer,
TLSClientConfig: &tls.Config{
@@ -78,17 +79,17 @@ func startHTTPHandler(state *State) {
}
gin.WrapH(wsProxy)(c)
return
} else {
proxy := httputil.NewSingleHostReverseProxy(url)
proxy.Transport = &http.Transport{
Dial: dialer,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: !*verifySSL,
},
}
gin.WrapH(proxy)(c)
return
}

proxy := httputil.NewSingleHostReverseProxy(&url)
proxy.Transport = &http.Transport{
Dial: dialer,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: !*verifySSL,
},
}
gin.WrapH(proxy)(c)
return
})

if *httpsEnabled {

0 comments on commit 3fb7d4a

Please sign in to comment.
You can’t perform that action at this time.