Commit f4cdf537 authored by Nimi Wariboko Jr's avatar Nimi Wariboko Jr

Proxy: Fix transport defn; cleanup connection.

parent d534a213
...@@ -212,7 +212,7 @@ func newConnHijackerTransport(base http.RoundTripper) *connHijackerTransport { ...@@ -212,7 +212,7 @@ func newConnHijackerTransport(base http.RoundTripper) *connHijackerTransport {
KeepAlive: 30 * time.Second, KeepAlive: 30 * time.Second,
}).Dial, }).Dial,
TLSHandshakeTimeout: 10 * time.Second, TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, DisableKeepAlives: true,
} }
if base != nil { if base != nil {
if baseTransport, ok := base.(*http.Transport); ok { if baseTransport, ok := base.(*http.Transport); ok {
...@@ -299,10 +299,9 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, outreq *http.Request, r ...@@ -299,10 +299,9 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, outreq *http.Request, r
if err != nil { if err != nil {
return err return err
} }
defer backendConn.Close()
outreq.Write(backendConn) outreq.Write(backendConn)
} }
defer backendConn.Close()
go func() { go func() {
io.Copy(backendConn, conn) // write tcp stream to backend. io.Copy(backendConn, conn) // write tcp stream to backend.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment