From c26f3ea1bbbb67d61eb69ba1f99eb62eb4246429 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 13 Jun 2019 13:56:31 +0200 Subject: [PATCH] fix: setting RemoteAddr field of a proxied request --- modules/http_proxy/http_proxy_js_request.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/http_proxy/http_proxy_js_request.go b/modules/http_proxy/http_proxy_js_request.go index f90a0885..76ed8f09 100644 --- a/modules/http_proxy/http_proxy_js_request.go +++ b/modules/http_proxy/http_proxy_js_request.go @@ -194,6 +194,8 @@ func (j *JSRequest) ToRequest() (req *http.Request) { } } + req.RemoteAddr = j.Client["IP"] + if !hadType && j.ContentType != "" { req.Header.Set("Content-Type", j.ContentType) }