Fix: nghttpx return 400 error (#84)

This commit is contained in:
beyondkmp 2019-01-07 10:47:25 +08:00 committed by Dreamacro
parent 15a77fa71b
commit 83fac44010

View file

@ -58,9 +58,9 @@ func (h *Http) shakeHand(metadata *C.Metadata, rw io.ReadWriter) error {
var buf bytes.Buffer var buf bytes.Buffer
var err error var err error
buf.WriteString("CONNECT ") addr := net.JoinHostPort(metadata.Host, metadata.Port)
buf.WriteString(net.JoinHostPort(metadata.Host, metadata.Port)) buf.WriteString("CONNECT " + addr + " HTTP/1.1\r\n")
buf.WriteString(" HTTP/1.1\r\n") buf.WriteString("Host: " + metadata.Host + "\r\n")
buf.WriteString("Proxy-Connection: Keep-Alive\r\n") buf.WriteString("Proxy-Connection: Keep-Alive\r\n")
if h.user != "" && h.pass != "" { if h.user != "" && h.pass != "" {