Skip to content

Commit

Permalink
Merge pull request #153 from kgraney/proxy_auth
Browse files Browse the repository at this point in the history
Add customizable HTTPS proxy authentication
  • Loading branch information
elazarl committed Apr 12, 2016
2 parents f3332c8 + a83bdc9 commit 970f4ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions https.go
Expand Up @@ -23,6 +23,7 @@ const (
ConnectMitm
ConnectHijack
ConnectHTTPMitm
ConnectProxyAuthHijack
)

var (
Expand Down Expand Up @@ -234,6 +235,9 @@ func (proxy *ProxyHttpServer) handleHttps(w http.ResponseWriter, r *http.Request
}
ctx.Logf("Exiting on EOF")
}()
case ConnectProxyAuthHijack:
proxyClient.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\n"))
todo.Hijack(r, proxyClient, ctx)
case ConnectReject:
if ctx.Resp != nil {
if err := ctx.Resp.Write(proxyClient); err != nil {
Expand Down

0 comments on commit 970f4ed

Please sign in to comment.