mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
balls
This commit is contained in:
parent
06033f1139
commit
93ae43fce3
1 changed files with 7 additions and 6 deletions
|
@ -33,7 +33,7 @@ const (
|
||||||
type HTTPProxy struct {
|
type HTTPProxy struct {
|
||||||
Name string
|
Name string
|
||||||
Address string
|
Address string
|
||||||
Server http.Server
|
Server *http.Server
|
||||||
Redirection *firewall.Redirection
|
Redirection *firewall.Redirection
|
||||||
Proxy *goproxy.ProxyHttpServer
|
Proxy *goproxy.ProxyHttpServer
|
||||||
Script *ProxyScript
|
Script *ProxyScript
|
||||||
|
@ -56,10 +56,11 @@ func stripPort(s string) string {
|
||||||
|
|
||||||
func NewHTTPProxy(s *session.Session) *HTTPProxy {
|
func NewHTTPProxy(s *session.Session) *HTTPProxy {
|
||||||
p := &HTTPProxy{
|
p := &HTTPProxy{
|
||||||
Name: "http.proxy",
|
Name: "http.proxy",
|
||||||
Proxy: goproxy.NewProxyHttpServer(),
|
Proxy: goproxy.NewProxyHttpServer(),
|
||||||
sess: s,
|
sess: s,
|
||||||
isTLS: false,
|
isTLS: false,
|
||||||
|
Server: nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Proxy.NonproxyHandler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
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),
|
Addr: fmt.Sprintf("%s:%d", p.Address, proxyPort),
|
||||||
Handler: p.Proxy,
|
Handler: p.Proxy,
|
||||||
ReadTimeout: httpReadTimeout,
|
ReadTimeout: httpReadTimeout,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue