fix npc http proxy verify bug

pull/298/head
刘河 2019-12-07 22:25:03 +08:00
parent 3fa7590400
commit 4ad17ba869
1 changed files with 2 additions and 2 deletions

View File

@ -198,7 +198,7 @@ func NewConn(tp string, vkey string, server string, connType string, proxyUrl st
return nil, er
}
connection, err = n.Dial("tcp", server)
case "http":
default:
connection, err = NewHttpProxyConn(u, server)
}
} else {
@ -262,7 +262,7 @@ func NewHttpProxyConn(url *url.URL, remoteAddr string) (net.Conn, error) {
Proto: "HTTP/1.1",
}
password, _ := url.User.Password()
req.Header.Set("Proxy-Authorization", "Basic "+basicAuth(url.User.Username(), password))
req.Header.Set("Authorization", "Basic "+basicAuth(strings.Trim(url.User.Username(), " "), password))
b, err := httputil.DumpRequest(req, false)
if err != nil {
return nil, err