Fix: firefox one socket to process multiple domains

This commit is contained in:
Dreamacro
2018-08-12 12:14:59 +08:00
parent 228d674d93
commit 35e572406b
3 changed files with 100 additions and 80 deletions

View File

@ -56,7 +56,7 @@ func NewHttpProxy(addr string) (*C.ProxySignal, error) {
func handleConn(conn net.Conn) {
br := bufio.NewReader(conn)
method, hostName := httpHostHeader(br)
method, hostName := adapters.ParserHTTPHostHeader(br)
if hostName == "" {
return
}
@ -75,5 +75,5 @@ func handleConn(conn net.Conn) {
peeked, _ = br.Peek(br.Buffered())
}
tun.Add(adapters.NewHttp(hostName, peeked, conn))
tun.Add(adapters.NewHttp(hostName, peeked, method != http.MethodConnect, conn))
}