diff --git a/proxyserver/main.go b/proxyserver/main.go index 46d17f42..b231f37d 100644 --- a/proxyserver/main.go +++ b/proxyserver/main.go @@ -100,7 +100,7 @@ func main() { indexHtmlPath := vueBuild + "/index.html" mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/api/") { - r.ParseMultipartForm(100 << 20) + r.ParseMultipartForm(500 << 20) // 对/api开头的请求进行反向代理 proxy := httputil.NewSingleHostReverseProxy(apiURL) proxy.ServeHTTP(w, r) @@ -179,14 +179,14 @@ func NewBackend(mux *http.ServeMux, httpAddress string, muxPaths ...string) *Bac client := &http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ - Timeout: 300 * time.Second, - KeepAlive: 60 * time.Second, + Timeout: 1500 * time.Second, + KeepAlive: 120 * time.Second, }).DialContext, ForceAttemptHTTP2: true, - MaxIdleConns: 100, - MaxIdleConnsPerHost: 100, - IdleConnTimeout: 300 * time.Second, - TLSHandshakeTimeout: 300 * time.Second, + MaxIdleConns: 200, + MaxIdleConnsPerHost: 200, + IdleConnTimeout: 600 * time.Second, + TLSHandshakeTimeout: 600 * time.Second, ExpectContinueTimeout: 1 * time.Second, }, }