Skip to content

Commit

Permalink
Added custom http.RoundTripper
Browse files Browse the repository at this point in the history
  • Loading branch information
jatanloya committed Nov 10, 2023
1 parent ea48d48 commit 5db4d83
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions enclave.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ func NewEnclave(cfg *Config) (*Enclave, error) {
// critical to boosting the requests per second that our reverse proxy can
// sustain. See the following comment for more details:
// https://github.com/brave/nitriding-daemon/issues/2#issuecomment-1530245059
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 500
http.DefaultTransport.(*http.Transport).MaxIdleConns = 500
customTransport := &http.Transport{
MaxIdleConns: 500,
MaxIdleConnsPerHost: 500,
}

if cfg.Debug {
e.attester = &dummyAttester{}
Expand Down Expand Up @@ -300,6 +302,7 @@ func NewEnclave(cfg *Config) (*Enclave, error) {
if cfg.AppWebSrv != nil {
e.revProxy = httputil.NewSingleHostReverseProxy(cfg.AppWebSrv)
e.revProxy.BufferPool = newBufPool()
e.revProxy.Transport = customTransport
e.extPubSrv.Handler.(*chi.Mux).Handle(pathProxy, e.revProxy)
// If we expose Prometheus metrics, we keep track of the HTTP backend's
// responses.
Expand Down

0 comments on commit 5db4d83

Please sign in to comment.