parent
5e4b35e03a
commit
34c8655974
1 changed files with 10 additions and 0 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -25,8 +26,13 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, proxy C.ProxyAdapter)
|
|||
conn := newTrafficTrack(proxy.Conn(), t.traffic)
|
||||
req := request.R
|
||||
host := req.Host
|
||||
keepalive := true
|
||||
|
||||
for {
|
||||
if strings.ToLower(req.Header.Get("Connection")) == "close" {
|
||||
keepalive = false
|
||||
}
|
||||
|
||||
req.Header.Set("Connection", "close")
|
||||
req.RequestURI = ""
|
||||
adapters.RemoveHopByHopHeaders(req.Header)
|
||||
|
@ -53,6 +59,10 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, proxy C.ProxyAdapter)
|
|||
break
|
||||
}
|
||||
|
||||
if !keepalive {
|
||||
break
|
||||
}
|
||||
|
||||
req, err = http.ReadRequest(bufio.NewReader(request.Conn()))
|
||||
if err != nil {
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue