Skip to content

Commit

Permalink
Fix odd timeout issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yunginnanet committed Nov 30, 2022
1 parent 508bd9d commit d92bfcf
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions mr_worldwide.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
package prox5

import (
"context"
"crypto/tls"
"net"
"net/http"
)

// GetHTTPClient retrieves a pointer to an http.Client powered by MysteryDialer.
func (p5 *ProxyEngine) GetHTTPClient() *http.Client {
var dctx func(ctx context.Context, network string, addr string) (net.Conn, error)
dctx = p5.DialContext
return &http.Client{
Transport: &http.Transport{
// Proxy: htp,
DialContext: dctx,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSHandshakeTimeout: p5.GetServerTimeout(),
DisableKeepAlives: true,
DisableCompression: false,
MaxIdleConnsPerHost: 5,
IdleConnTimeout: p5.GetServerTimeout(),
ResponseHeaderTimeout: p5.GetServerTimeout(),
DialContext: p5.DialContext,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
// TLSHandshakeTimeout: p5.GetServerTimeout(),
DisableKeepAlives: true,
DisableCompression: false,
MaxIdleConnsPerHost: 5,
// IdleConnTimeout: p5.GetServerTimeout(),
// ResponseHeaderTimeout: p5.GetServerTimeout(),
},
Timeout: p5.GetServerTimeout(),
}
Expand Down

0 comments on commit d92bfcf

Please sign in to comment.