|
@@ -1,6 +1,7 @@
|
|
|
package dpcore
|
|
|
|
|
|
import (
|
|
|
+ "context"
|
|
|
"errors"
|
|
|
"io"
|
|
|
"log"
|
|
@@ -96,6 +97,10 @@ func NewDynamicProxyCore(target *url.URL, prepender string, ignoreTLSVerificatio
|
|
|
thisTransporter.(*http.Transport).MaxIdleConnsPerHost = optimalConcurrentConnection
|
|
|
thisTransporter.(*http.Transport).IdleConnTimeout = 60 * time.Second
|
|
|
thisTransporter.(*http.Transport).MaxConnsPerHost = optimalConcurrentConnection + 3
|
|
|
+
|
|
|
+ thisTransporter.(*http.Transport).DialContext = defaultTransportDialContext(&net.Dialer{
|
|
|
+ Timeout: 3 * time.Second,
|
|
|
+ })
|
|
|
thisTransporter.(*http.Transport).DisableCompression = true
|
|
|
|
|
|
if ignoreTLSVerification {
|
|
@@ -111,6 +116,10 @@ func NewDynamicProxyCore(target *url.URL, prepender string, ignoreTLSVerificatio
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func defaultTransportDialContext(dialer *net.Dialer) func(context.Context, string, string) (net.Conn, error) {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
func singleJoiningSlash(a, b string) string {
|
|
|
aslash := strings.HasSuffix(a, "/")
|
|
|
bslash := strings.HasPrefix(b, "/")
|