Enhance reverse proxy transport configuration for improved performance. Updated reverse.go to set a direct transport for the reverse proxy, ensuring more efficient request handling. Modified gateway.go to utilize the direct transport with customized connection settings, optimizing idle connections and timeouts.
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
// (e.g. https://host/api/ + v1 + users → https://host/api/v1/users).
|
||||
func NewReverseProxy(target *url.URL, stripPrefix, pathPrefix string, setAuth string) *httputil.ReverseProxy {
|
||||
proxy := httputil.NewSingleHostReverseProxy(target)
|
||||
proxy.Transport = DirectTransport()
|
||||
orig := proxy.Director
|
||||
targetQuery := target.RawQuery
|
||||
proxy.Director = func(req *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user