mirror of https://github.com/ehang-io/nps
fix npc http proxy verify bug
parent
3fa7590400
commit
4ad17ba869
|
@ -198,7 +198,7 @@ func NewConn(tp string, vkey string, server string, connType string, proxyUrl st
|
||||||
return nil, er
|
return nil, er
|
||||||
}
|
}
|
||||||
connection, err = n.Dial("tcp", server)
|
connection, err = n.Dial("tcp", server)
|
||||||
case "http":
|
default:
|
||||||
connection, err = NewHttpProxyConn(u, server)
|
connection, err = NewHttpProxyConn(u, server)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -262,7 +262,7 @@ func NewHttpProxyConn(url *url.URL, remoteAddr string) (net.Conn, error) {
|
||||||
Proto: "HTTP/1.1",
|
Proto: "HTTP/1.1",
|
||||||
}
|
}
|
||||||
password, _ := url.User.Password()
|
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)
|
b, err := httputil.DumpRequest(req, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue