Merge pull request #1144 from projectdiscovery/issue-1129-headless-proxy

Fixing http proxy not working in headless browser
dev
Ice3man 2021-10-18 19:54:23 +05:30 committed by GitHub
commit 6741cfb4f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package engine
import (
"crypto/tls"
"net/http"
"net/url"
"time"
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolstate"
@ -22,5 +23,12 @@ func newhttpClient(options *types.Options) *http.Client {
InsecureSkipVerify: true,
},
}
if options.ProxyURL != "" {
if proxyURL, err := url.Parse(options.ProxyURL); err == nil {
transport.Proxy = http.ProxyURL(proxyURL)
}
}
return &http.Client{Transport: transport, Timeout: time.Duration(options.Timeout*3) * time.Second}
}

View File

@ -8,7 +8,7 @@ import (
"github.com/go-rod/rod/lib/proto"
)
// Page is a single page in an isolated browser instanace
// Page is a single page in an isolated browser instance
type Page struct {
page *rod.Page
rules []requestRule