mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
require proxy auth when not set. fix #712
This commit is contained in:
parent
5c9f54a453
commit
ed1243b32b
@ -103,7 +103,11 @@ Start:
|
||||
|
||||
if len(s.config.Accounts) > 0 {
|
||||
user, pass, ok := parseBasicAuth(request.Header.Get("Proxy-Authorization"))
|
||||
if !ok || !s.config.HasAccount(user, pass) {
|
||||
if !ok {
|
||||
_, err := conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\n\r\n"))
|
||||
return err
|
||||
}
|
||||
if !s.config.HasAccount(user, pass) {
|
||||
_, err := conn.Write([]byte("HTTP/1.1 401 UNAUTHORIZED\r\n\r\n"))
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user