From 994705e0070de0e1df18e19419ad627f4fbeac36 Mon Sep 17 00:00:00 2001 From: WJQSERVER Date: Mon, 27 Jan 2025 14:30:32 +0800 Subject: [PATCH] update config --- README.md | 1 - config/config.go | 11 +++++------ config/config.toml | 1 - deploy/config.toml | 1 - main.go | 2 +- proxy/chunkreq.go | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 29aff6b..131a8e4 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,6 @@ wget -O install.sh https://raw.githubusercontent.com/WJQSERVER-STUDIO/ghproxy/ma host = "0.0.0.0" # 监听地址 port = 8080 # 监听端口 sizeLimit = 125 # 125MB -bufferSize = 4096 # Bytes 缓冲区大小 enableH2C = "on" # 是否开启H2C传输(latest和dev版本请开启) on/off [pages] diff --git a/config/config.go b/config/config.go index 0747d62..ea325a4 100644 --- a/config/config.go +++ b/config/config.go @@ -16,12 +16,11 @@ type Config struct { } type ServerConfig struct { - Port int `toml:"port"` - Host string `toml:"host"` - SizeLimit int `toml:"sizeLimit"` - EnableH2C string `toml:"enableH2C"` - BufferSize int `toml:"bufferSize"` - Debug bool `toml:"debug"` + Port int `toml:"port"` + Host string `toml:"host"` + SizeLimit int `toml:"sizeLimit"` + EnableH2C string `toml:"enableH2C"` + Debug bool `toml:"debug"` } type PagesConfig struct { diff --git a/config/config.toml b/config/config.toml index c1995b9..5d1900f 100644 --- a/config/config.toml +++ b/config/config.toml @@ -3,7 +3,6 @@ host = "0.0.0.0" port = 8080 sizeLimit = 125 # MB enableH2C = "on" # "on" or "off" -bufferSize = 4096 # Bytes debug = false [pages] diff --git a/deploy/config.toml b/deploy/config.toml index cc49eff..6053f12 100644 --- a/deploy/config.toml +++ b/deploy/config.toml @@ -2,7 +2,6 @@ host = "127.0.0.1" port = 8080 sizeLimit = 125 # MB -bufferSize = 4096 # Bytes enableH2C = false debug = false diff --git a/main.go b/main.go index d7e5c6d..36be801 100644 --- a/main.go +++ b/main.go @@ -92,7 +92,7 @@ func setupRateLimit(cfg *config.Config) { } func InitReq() { - proxy.InitReq(cfg.Server.BufferSize) + proxy.InitReq() } func init() { diff --git a/proxy/chunkreq.go b/proxy/chunkreq.go index 72fac16..a0e4fca 100644 --- a/proxy/chunkreq.go +++ b/proxy/chunkreq.go @@ -20,7 +20,7 @@ var ( BufferPool *sync.Pool ) -func InitReq(cfgBufferSize int) { +func InitReq() { initChunkedHTTPClient() initGitHTTPClient()