1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

fix basic auth response

This commit is contained in:
Darien Raymond 2017-12-05 23:49:16 +01:00
parent 82009c869e
commit b81ff78af3
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -118,11 +118,10 @@ Start:
return trace
}
if len(s.config.Accounts) > 0 {
if len(s.config.Accounts) > 0 {
user, pass, ok := parseBasicAuth(request.Header.Get("Proxy-Authorization"))
if !ok || !s.config.HasAccount(user, pass) {
_, err := conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\n" +
"Proxy-Authenticate: Basic realm=\"V2Ray\"\r\n\r\n"))
_, err := conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\n\r\n"))
return err
}
}