Add timeout on proxy connections
This commit is contained in:
@@ -170,7 +170,10 @@ func fetchPage(url string, connectionId int) (string, error) {
|
||||
func getHttpClient(connectionId int) (*http.Client, error) {
|
||||
// setup a http client
|
||||
httpTransport := &http.Transport{}
|
||||
httpClient := &http.Client{Transport: httpTransport}
|
||||
httpClient := &http.Client{
|
||||
Transport: httpTransport,
|
||||
Timeout: time.Duration(c.ClientConfig.FetchTimeout) * time.Second,
|
||||
}
|
||||
|
||||
if len(proxyList) == 0 {
|
||||
log.Printf("(%d) [PROXY] No proxy found, will continue without proxy!\n", connectionId)
|
||||
|
||||
Reference in New Issue
Block a user