mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 02:09:47 +08:00
Proxy: Fix transport defn; cleanup connection.
This commit is contained in:
parent
d534a2139f
commit
f4cdf53761
|
@ -212,7 +212,7 @@ func newConnHijackerTransport(base http.RoundTripper) *connHijackerTransport {
|
|||
KeepAlive: 30 * time.Second,
|
||||
}).Dial,
|
||||
TLSHandshakeTimeout: 10 * time.Second,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
DisableKeepAlives: true,
|
||||
}
|
||||
if base != nil {
|
||||
if baseTransport, ok := base.(*http.Transport); ok {
|
||||
|
@ -299,10 +299,9 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, outreq *http.Request, r
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer backendConn.Close()
|
||||
|
||||
outreq.Write(backendConn)
|
||||
}
|
||||
defer backendConn.Close()
|
||||
|
||||
go func() {
|
||||
io.Copy(backendConn, conn) // write tcp stream to backend.
|
||||
|
|
Loading…
Reference in New Issue
Block a user