ソースを参照

auto update script executed

Toby Chui 1 年間 前
コミット
40ea6925df
1 ファイル変更5 行追加3 行削除
  1. 5 3
      mod/dynamicproxy/dpcore/dpcore.go

+ 5 - 3
mod/dynamicproxy/dpcore/dpcore.go

@@ -90,14 +90,16 @@ func NewDynamicProxyCore(target *url.URL, prepender string) *ReverseProxy {
 	}
 
 	//Hack the default transporter to handle more connections
-	http.DefaultTransport.(*http.Transport).MaxIdleConns = 1000
-	http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 1000
+	thisTransporter := http.DefaultTransport
+	thisTransporter.(*http.Transport).MaxIdleConns = 1000
+	thisTransporter.(*http.Transport).MaxIdleConnsPerHost = 1000
+	thisTransporter.(*http.Transport).MaxConnsPerHost = 30
 
 	return &ReverseProxy{
 		Director:  director,
 		Prepender: prepender,
 		Verbal:    false,
-		Transport: http.DefaultTransport,
+		Transport: thisTransporter,
 	}
 }