Inithttp 初始化HTTP客户端配置
(cfg *common.Config)
| 37 | |
| 38 | // Inithttp 初始化HTTP客户端配置 |
| 39 | func Inithttp(cfg *common.Config) error { |
| 40 | // 获取POC并发数,默认20 |
| 41 | pocNum := cfg.POC.Num |
| 42 | if pocNum == 0 { |
| 43 | pocNum = 20 |
| 44 | } |
| 45 | |
| 46 | // 初始化HTTP客户端 |
| 47 | err := InitHTTPClient(pocNum, cfg.Network.HTTPProxy, cfg.Network.WebTimeout, cfg.Network.MaxRedirects, &cfg.Network) |
| 48 | if err != nil { |
| 49 | return fmt.Errorf("HTTP客户端初始化失败: %w", err) |
| 50 | } |
| 51 | return nil |
| 52 | } |
| 53 | |
| 54 | // configureHTTPProxy 统一配置HTTP代理(SOCKS5优先于HTTP代理) |
| 55 | func configureHTTPProxy(tr *http.Transport, legacyProxy string, networkConfig *common.NetworkConfig) error { |
no test coverage detected