Skip to content

Commit

Permalink
fix basic auth response
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Dec 5, 2017
1 parent 82009c8 commit b81ff78
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions proxy/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit b81ff78

Please sign in to comment.