修复url解析错误的bug

修复redirect的wg计算错误的bug
This commit is contained in:
M09Ic 2023-04-06 21:20:24 +08:00
parent ccc9ca3719
commit 1bcf2f297d
4 changed files with 6 additions and 6 deletions

View File

@ -366,7 +366,7 @@ func (opt *Option) PrepareRunner() (*Runner, error) {
u, _ = url.Parse("http://" + opt.URL[0]) u, _ = url.Parse("http://" + opt.URL[0])
} }
go func() { go func() {
opt.GenerateTasks(tasks, u.Hostname(), ports) opt.GenerateTasks(tasks, u.String(), ports)
close(tasks) close(tasks)
}() }()
taskfrom = u.Host taskfrom = u.Host

View File

@ -583,7 +583,6 @@ func (pool *Pool) doRedirect(bl *pkg.Baseline, depth int) {
pool.waiter.Add(1) pool.waiter.Add(1)
go func() { go func() {
defer pool.waiter.Done()
pool.addAddition(&Unit{ pool.addAddition(&Unit{
path: reURL, path: reURL,
source: RedirectSource, source: RedirectSource,

View File

@ -108,7 +108,7 @@ func (r *Runner) PrepareConfig() *pkg.Config {
RandomUserAgent: r.RandomUserAgent, RandomUserAgent: r.RandomUserAgent,
} }
if config.ClientType == 0 { if config.ClientType == ihttp.Auto {
if config.Mod == pkg.PathSpray { if config.Mod == pkg.PathSpray {
config.ClientType = ihttp.FAST config.ClientType = ihttp.FAST
} else if config.Mod == pkg.HostSpray { } else if config.Mod == pkg.HostSpray {

View File

@ -51,6 +51,7 @@ func NewClient(thread int, timeout int, clientType int) *Client {
Renegotiation: tls.RenegotiateOnceAsClient, Renegotiation: tls.RenegotiateOnceAsClient,
InsecureSkipVerify: true, InsecureSkipVerify: true,
}, },
TLSHandshakeTimeout: time.Duration(timeout) * time.Second,
MaxConnsPerHost: thread * 3 / 2, MaxConnsPerHost: thread * 3 / 2,
IdleConnTimeout: time.Duration(timeout) * time.Second, IdleConnTimeout: time.Duration(timeout) * time.Second,
ReadBufferSize: 16384, // 16k ReadBufferSize: 16384, // 16k