diff --git a/internal/option.go b/internal/option.go index 09b5c9e..e3ec114 100644 --- a/internal/option.go +++ b/internal/option.go @@ -366,7 +366,7 @@ func (opt *Option) PrepareRunner() (*Runner, error) { u, _ = url.Parse("http://" + opt.URL[0]) } go func() { - opt.GenerateTasks(tasks, u.Hostname(), ports) + opt.GenerateTasks(tasks, u.String(), ports) close(tasks) }() taskfrom = u.Host diff --git a/internal/pool.go b/internal/pool.go index 8301227..55bcf77 100644 --- a/internal/pool.go +++ b/internal/pool.go @@ -583,7 +583,6 @@ func (pool *Pool) doRedirect(bl *pkg.Baseline, depth int) { pool.waiter.Add(1) go func() { - defer pool.waiter.Done() pool.addAddition(&Unit{ path: reURL, source: RedirectSource, diff --git a/internal/runner.go b/internal/runner.go index 68162d6..2920f17 100644 --- a/internal/runner.go +++ b/internal/runner.go @@ -108,7 +108,7 @@ func (r *Runner) PrepareConfig() *pkg.Config { RandomUserAgent: r.RandomUserAgent, } - if config.ClientType == 0 { + if config.ClientType == ihttp.Auto { if config.Mod == pkg.PathSpray { config.ClientType = ihttp.FAST } else if config.Mod == pkg.HostSpray { diff --git a/pkg/ihttp/client.go b/pkg/ihttp/client.go index 05b3cae..39d093b 100644 --- a/pkg/ihttp/client.go +++ b/pkg/ihttp/client.go @@ -51,9 +51,10 @@ func NewClient(thread int, timeout int, clientType int) *Client { Renegotiation: tls.RenegotiateOnceAsClient, InsecureSkipVerify: true, }, - MaxConnsPerHost: thread * 3 / 2, - IdleConnTimeout: time.Duration(timeout) * time.Second, - ReadBufferSize: 16384, // 16k + TLSHandshakeTimeout: time.Duration(timeout) * time.Second, + MaxConnsPerHost: thread * 3 / 2, + IdleConnTimeout: time.Duration(timeout) * time.Second, + ReadBufferSize: 16384, // 16k }, Timeout: time.Second * time.Duration(timeout), CheckRedirect: func(req *http.Request, via []*http.Request) error {