瀏覽代碼

fix npc http proxy verify bug

刘河 5 年之前
父節點
當前提交
4ad17ba869
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      client/control.go

+ 2 - 2
client/control.go

@@ -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