http: increase default response header timeout to 60s, add option to customize it, schema update

This commit is contained in:
yusing
2025-01-30 00:41:03 +08:00
parent d9b6b82f07
commit dfc634a362
18 changed files with 96 additions and 28 deletions

View File

@@ -44,11 +44,15 @@ type (
// var globalMux = http.NewServeMux() // TODO: support regex subdomain matching.
func NewHTTPRoute(entry *entry.ReverseProxyEntry) (impl, E.Error) {
var trans *http.Transport
if entry.Raw.NoTLSVerify {
trans := gphttp.DefaultTransport
httpConfig := entry.Raw.HTTPConfig
if httpConfig.NoTLSVerify {
trans = gphttp.DefaultTransportNoTLS
} else {
trans = gphttp.DefaultTransport
}
if httpConfig.ResponseHeaderTimeout > 0 {
trans = trans.Clone()
trans.ResponseHeaderTimeout = httpConfig.ResponseHeaderTimeout
}
service := entry.TargetName()