Fix: close connection when response closed

This commit is contained in:
Dreamacro 2018-08-31 21:24:10 +08:00
parent f4c51cdb0e
commit f2dbabeaa0
1 changed files with 4 additions and 1 deletions

View File

@ -36,7 +36,10 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, proxy C.ProxyAdapter)
} else {
resp.Close = true
}
resp.Write(request.Conn())
err = resp.Write(request.Conn())
if err != nil || resp.Close {
break
}
req, err = http.ReadRequest(bufio.NewReader(request.Conn()))
if err != nil {