Skip to content

Commit 1643fdc

Browse files
committed
updated timeouts for HTTP requests
1 parent ed5c7c4 commit 1643fdc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/http/http.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const (
3939
defaultUserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
4040
windowsUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
4141
darwinUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
42-
httpTimeout = 20 * time.Second
42+
httpTimeout = 10 * time.Second
4343
handshakeTimeout = 5 * time.Second
4444
)
4545

@@ -93,7 +93,7 @@ func init() {
9393
DialContext: amassnet.DialContext,
9494
MaxIdleConns: 200,
9595
MaxConnsPerHost: 50,
96-
IdleConnTimeout: 30 * time.Second,
96+
IdleConnTimeout: 10 * time.Second,
9797
TLSHandshakeTimeout: handshakeTimeout,
9898
ExpectContinueTimeout: 5 * time.Second,
9999
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
@@ -254,7 +254,7 @@ func Crawl(ctx context.Context, u string, scope []string, max int, callback func
254254
UserAgent: UserAgent,
255255
LogDisabled: true,
256256
ConcurrentRequests: 5,
257-
RequestDelay: time.Second,
257+
RequestDelay: 50 * time.Millisecond,
258258
RequestDelayRandomize: true,
259259
ParseFunc: func(g *geziyor.Geziyor, r *client.Response) {
260260
select {

0 commit comments

Comments
 (0)