修复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])
}
go func() {
opt.GenerateTasks(tasks, u.Hostname(), ports)
opt.GenerateTasks(tasks, u.String(), ports)
close(tasks)
}()
taskfrom = u.Host

View File

@ -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,

View File

@ -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 {

View File

@ -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 {