From ddb8f970053a5de301a8532ddf7de5b3e29801ef Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 17 Sep 2023 18:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BD=91=E7=AB=99=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD=E5=A2=9E=E5=8A=A0Ln=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/global_server_config.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkg/serverconfigs/global_server_config.go b/pkg/serverconfigs/global_server_config.go index 347ed4b..bb87475 100644 --- a/pkg/serverconfigs/global_server_config.go +++ b/pkg/serverconfigs/global_server_config.go @@ -2,10 +2,19 @@ package serverconfigs +type LnRequestSchedulingMethod = string + +const ( + LnRequestSchedulingMethodRandom LnRequestSchedulingMethod = "random" + LnRequestSchedulingMethodURLMapping LnRequestSchedulingMethod = "urlMapping" +) + func NewGlobalServerConfig() *GlobalServerConfig { var config = &GlobalServerConfig{} + config.HTTPAll.SupportsLowVersionHTTP = true config.HTTPAll.EnableServerAddrVariable = true + config.HTTPAll.LnRequestSchedulingMethod = LnRequestSchedulingMethodURLMapping config.HTTPAccessLog.IsOn = true config.HTTPAccessLog.EnableRequestHeaders = true @@ -36,11 +45,12 @@ type GlobalServerConfig struct { DefaultDomain string `yaml:"defaultDomain" json:"defaultDomain"` // 默认的域名 DomainMismatchAction *DomainMismatchAction `yaml:"domainMismatchAction" json:"domainMismatchAction"` // 不匹配时采取的动作 - SupportsLowVersionHTTP bool `yaml:"supportsLowVersionHTTP" json:"supportsLowVersionHTTP"` // 是否启用低版本HTTP - MatchCertFromAllServers bool `yaml:"matchCertFromAllServers" json:"matchCertFromAllServers"` // 从所有服务中匹配证书(不要轻易开启!) - ForceLnRequest bool `yaml:"forceLnRequest" json:"forceLnRequest"` // 强制从Ln请求内容 - ServerName string `yaml:"serverName" json:"serverName"` // Server名称 - EnableServerAddrVariable bool `yaml:"enableServerAddrVariable" json:"enableServerAddrVariable"` // 是否支持${serverAddr}变量 + SupportsLowVersionHTTP bool `yaml:"supportsLowVersionHTTP" json:"supportsLowVersionHTTP"` // 是否启用低版本HTTP + MatchCertFromAllServers bool `yaml:"matchCertFromAllServers" json:"matchCertFromAllServers"` // 从所有服务中匹配证书(不要轻易开启!) + ForceLnRequest bool `yaml:"forceLnRequest" json:"forceLnRequest"` // 强制从Ln请求内容 + LnRequestSchedulingMethod LnRequestSchedulingMethod `yaml:"lnRequestSchedulingMethod" json:"lnRequestSchedulingMethod"` // Ln请求调度方法 + ServerName string `yaml:"serverName" json:"serverName"` // Server名称 + EnableServerAddrVariable bool `yaml:"enableServerAddrVariable" json:"enableServerAddrVariable"` // 是否支持${serverAddr}变量 } `yaml:"httpAll" json:"httpAll"` // HTTP统一配置 HTTPAccessLog struct {