(timeout uint8)
| 45 | } |
| 46 | |
| 47 | func proxyClient(timeout uint8) *http.Client { |
| 48 | proxy := func(_ *http.Request) (*url.URL, error) { |
| 49 | return url.Parse(config.Cfg.Proxy.ProxyUrl) |
| 50 | } |
| 51 | |
| 52 | transport := &http.Transport{Proxy: proxy} |
| 53 | client := &http.Client{ |
| 54 | Transport: transport, |
| 55 | Timeout: time.Duration(timeout) * time.Second, |
| 56 | } |
| 57 | return client |
| 58 | } |
| 59 | |
| 60 | func CrawlerClient() *http.Client { |
| 61 | if config.Cfg.Proxy.CrawlerProxyEnabled { |
no outgoing calls
no test coverage detected