From 93ae43fce30c85594565f014cf6436dfe22871e3 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 8 Feb 2018 05:21:32 +0100 Subject: [PATCH] balls --- modules/http_proxy_base.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/http_proxy_base.go b/modules/http_proxy_base.go index 9cf78168..0d520e0f 100644 --- a/modules/http_proxy_base.go +++ b/modules/http_proxy_base.go @@ -33,7 +33,7 @@ const ( type HTTPProxy struct { Name string Address string - Server http.Server + Server *http.Server Redirection *firewall.Redirection Proxy *goproxy.ProxyHttpServer Script *ProxyScript @@ -56,10 +56,11 @@ func stripPort(s string) string { func NewHTTPProxy(s *session.Session) *HTTPProxy { p := &HTTPProxy{ - Name: "http.proxy", - Proxy: goproxy.NewProxyHttpServer(), - sess: s, - isTLS: false, + Name: "http.proxy", + Proxy: goproxy.NewProxyHttpServer(), + sess: s, + isTLS: false, + Server: nil, } p.Proxy.NonproxyHandler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { @@ -153,7 +154,7 @@ func (p *HTTPProxy) Configure(address string, proxyPort int, httpPort int, scrip } } - p.Server = http.Server{ + p.Server = &http.Server{ Addr: fmt.Sprintf("%s:%d", p.Address, proxyPort), Handler: p.Proxy, ReadTimeout: httpReadTimeout,