From a01e058d8298d5d49c0e431646c4b51376bd0f41 Mon Sep 17 00:00:00 2001 From: stefan_hofbauer Date: Sun, 19 Apr 2020 15:50:45 +0200 Subject: [PATCH] Fix problem with the client ip in https.proxy as described in https://github.com/bettercap/caplets/issues/45 --- modules/http_proxy/http_proxy_base.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/http_proxy/http_proxy_base.go b/modules/http_proxy/http_proxy_base.go index 13cce828..c2eb8631 100644 --- a/modules/http_proxy/http_proxy_base.go +++ b/modules/http_proxy/http_proxy_base.go @@ -378,8 +378,9 @@ func (p *HTTPProxy) httpsWorker() error { Opaque: hostname, Host: net.JoinHostPort(hostname, "443"), }, - Host: hostname, - Header: make(http.Header), + Host: hostname, + Header: make(http.Header), + RemoteAddr: c.RemoteAddr().String(), } p.Proxy.ServeHTTP(dumbResponseWriter{tlsConn}, req) }(c)