diff --git a/tunnel/connection.go b/tunnel/connection.go index 581ca1ac..27a24a42 100644 --- a/tunnel/connection.go +++ b/tunnel/connection.go @@ -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 {