mirror of https://github.com/daffainfo/nuclei.git
commit
bb4774623e
|
@ -72,6 +72,7 @@ func (r *Runner) processTemplateWithList(p progress.IProgress, template *templat
|
|||
Decolorizer: r.decolorizer,
|
||||
StopAtFirstMatch: r.options.StopAtFirstMatch,
|
||||
PF: r.pf,
|
||||
Dialer: &r.dialer,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/logrusorgru/aurora"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/projectdiscovery/gologger"
|
||||
"github.com/projectdiscovery/httpx/common/cache"
|
||||
"github.com/projectdiscovery/nuclei/v2/internal/bufwriter"
|
||||
"github.com/projectdiscovery/nuclei/v2/internal/progress"
|
||||
"github.com/projectdiscovery/nuclei/v2/internal/tracelog"
|
||||
|
@ -48,6 +49,9 @@ type Runner struct {
|
|||
// output coloring
|
||||
colorizer colorizer.NucleiColorizer
|
||||
decolorizer *regexp.Regexp
|
||||
|
||||
// http dialer
|
||||
dialer cache.DialerFunc
|
||||
}
|
||||
|
||||
// New creates a new client for running enumeration process.
|
||||
|
@ -194,6 +198,12 @@ func New(options *Options) (*Runner, error) {
|
|||
collaborator.DefaultCollaborator.Collab.AddBIID(options.BurpCollaboratorBiid)
|
||||
}
|
||||
|
||||
// Create Dialer
|
||||
runner.dialer, err = cache.NewDialer(cache.DefaultOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return runner, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -89,14 +89,16 @@ type HTTPOptions struct {
|
|||
ColoredOutput bool
|
||||
StopAtFirstMatch bool
|
||||
PF *projetctfile.ProjectFile
|
||||
Dialer *cache.DialerFunc
|
||||
}
|
||||
|
||||
// NewHTTPExecuter creates a new HTTP executer from a template
|
||||
// and a HTTP request query.
|
||||
func NewHTTPExecuter(options *HTTPOptions) (*HTTPExecuter, error) {
|
||||
var proxyURL *url.URL
|
||||
|
||||
var err error
|
||||
var (
|
||||
proxyURL *url.URL
|
||||
err error
|
||||
)
|
||||
|
||||
if options.ProxyURL != "" {
|
||||
proxyURL, err = url.Parse(options.ProxyURL)
|
||||
|
@ -601,13 +603,8 @@ func makeHTTPClient(proxyURL *url.URL, options *HTTPOptions) (*retryablehttp.Cli
|
|||
followRedirects := options.BulkHTTPRequest.Redirects
|
||||
maxRedirects := options.BulkHTTPRequest.MaxRedirects
|
||||
|
||||
dialer, err := cache.NewDialer(cache.DefaultOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
transport := &http.Transport{
|
||||
DialContext: dialer,
|
||||
DialContext: *options.Dialer,
|
||||
MaxIdleConns: maxIdleConns,
|
||||
MaxIdleConnsPerHost: maxIdleConnsPerHost,
|
||||
MaxConnsPerHost: maxConnsPerHost,
|
||||
|
|
Loading…
Reference in New Issue