mirror of
https://github.com/chainreactors/spray.git
synced 2025-06-21 18:30:49 +00:00
修复代理为空时的报错bug
This commit is contained in:
parent
f35a07050e
commit
2222b49632
@ -241,13 +241,10 @@ func (opt *Option) PrepareRunner() (*Runner, error) {
|
||||
if len(opt.AppendRule) > 0 {
|
||||
s.WriteString("file bak enable; ")
|
||||
}
|
||||
if s.Len() > 0 {
|
||||
logs.Log.Important("Advance Mod: " + s.String())
|
||||
}
|
||||
|
||||
if r.RetryCount > 0 {
|
||||
logs.Log.Important("Retry Count: " + strconv.Itoa(r.RetryCount))
|
||||
s.WriteString("Retry Count: " + strconv.Itoa(r.RetryCount))
|
||||
}
|
||||
logs.Log.Important(s.String())
|
||||
|
||||
if opt.NoScope {
|
||||
r.Scope = []string{"*"}
|
||||
@ -301,6 +298,7 @@ func (opt *Option) PrepareRunner() (*Runner, error) {
|
||||
opt.Word = "{@prefix}" + opt.Word
|
||||
}
|
||||
|
||||
// 类似dirsearch中的
|
||||
if opt.Extensions != "" {
|
||||
exts := strings.Split(opt.Extensions, ",")
|
||||
for i, e := range exts {
|
||||
|
@ -118,6 +118,11 @@ func (c *Client) Do(ctx context.Context, req *Request) (*Response, error) {
|
||||
}
|
||||
|
||||
func customDialFunc(proxyAddr string, timeout time.Duration) fasthttp.DialFunc {
|
||||
if proxyAddr == "" {
|
||||
return func(addr string) (net.Conn, error) {
|
||||
return fasthttp.DialTimeout(addr, timeout)
|
||||
}
|
||||
}
|
||||
u, err := url.Parse(proxyAddr)
|
||||
if err != nil {
|
||||
logs.Log.Error(err.Error())
|
||||
|
Loading…
x
Reference in New Issue
Block a user