diff --git a/https.go b/https.go index d5b30963..c9e76e9e 100644 --- a/https.go +++ b/https.go @@ -36,6 +36,10 @@ var ( httpsRegexp = regexp.MustCompile(`^https:\/\/`) ) +// ConnectAction enables the caller to override the standard connect flow. +// When Action is ConnectHijack, it is up to the implementer to send the +// HTTP 200, or any other valid http response back to the client from within the +// Hijack func type ConnectAction struct { Action ConnectActionLiteral Hijack func(req *http.Request, client net.Conn, ctx *ProxyCtx) @@ -129,8 +133,6 @@ func (proxy *ProxyHttpServer) handleHttps(w http.ResponseWriter, r *http.Request } case ConnectHijack: - ctx.Logf("Hijacking CONNECT to %s", host) - proxyClient.Write([]byte("HTTP/1.0 200 OK\r\n\r\n")) todo.Hijack(r, proxyClient, ctx) case ConnectHTTPMitm: proxyClient.Write([]byte("HTTP/1.0 200 OK\r\n\r\n"))