rewrite path matcher

This commit is contained in:
wjqserver 2025-03-13 18:16:17 +08:00
parent 6ee928b0c7
commit 9bfe8517cb
7 changed files with 206 additions and 178 deletions

View file

@ -44,12 +44,18 @@ func initHTTPClient(cfg *config.Config) {
}).DialContext,
}
*/
var proTolcols = new(http.Protocols)
proTolcols.SetHTTP1(true)
proTolcols.SetHTTP2(true)
proTolcols.SetUnencryptedHTTP2(true)
if cfg.Httpc.Mode == "auto" {
tr = &http.Transport{
//MaxIdleConns: 160,
IdleConnTimeout: 30 * time.Second,
WriteBufferSize: 32 * 1024, // 32KB
ReadBufferSize: 32 * 1024, // 32KB
Protocols: proTolcols,
}
} else if cfg.Httpc.Mode == "advanced" {
tr = &http.Transport{
@ -58,6 +64,7 @@ func initHTTPClient(cfg *config.Config) {
MaxIdleConnsPerHost: cfg.Httpc.MaxIdleConnsPerHost,
WriteBufferSize: 32 * 1024, // 32KB
ReadBufferSize: 32 * 1024, // 32KB
Protocols: proTolcols,
}
} else {
// 错误的模式