You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two bugs on HTTP proxy.
[ ] We should reuse http.Client and let user custom it in the config, like MaxIdleConnsPerHost, etc.
[ ] We should close Body so that the connection can be reused. What happened:
routerfiller.go
req.Header=r.Header// creat http client too many timescli:=&http3.Client{
Transport: f.transport,
Timeout: hc.Timeout,
}
resp, err:=cli.Do(req)
manger.go
func (hcm*HttpConnectionManager) buildTargetResponse(c*pch.HttpContext) {
ifc.LocalReply() {
return
}
switchres:=c.SourceResp.(type) {
case*stdHttp.Response:
//It is the caller's responsibility to// close Body. The default HTTP client's Transport may not// reuse HTTP/1.x "keep-alive" TCP connections if the Body is// not read to completion and closed.body, err:=io.ReadAll(res.Body)
iferr!=nil {
panic(err)
}
//Merge headerremoteHeader:=res.Headerfork:=rangeremoteHeader {
c.AddHeader(k, remoteHeader.Get(k))
}
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
The text was updated successfully, but these errors were encountered:
There are two bugs on HTTP proxy.
[ ] We should reuse http.Client and let user custom it in the config, like MaxIdleConnsPerHost, etc.
[ ] We should close Body so that the connection can be reused.
What happened:
routerfiller.go
manger.go
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
The text was updated successfully, but these errors were encountered: