全局网站设置中增加Ln请求调度方法

This commit is contained in:
GoEdgeLab
2023-09-17 18:37:08 +08:00
parent d6fad4a5a1
commit ddb8f97005

View File

@@ -2,10 +2,19 @@
package serverconfigs package serverconfigs
type LnRequestSchedulingMethod = string
const (
LnRequestSchedulingMethodRandom LnRequestSchedulingMethod = "random"
LnRequestSchedulingMethodURLMapping LnRequestSchedulingMethod = "urlMapping"
)
func NewGlobalServerConfig() *GlobalServerConfig { func NewGlobalServerConfig() *GlobalServerConfig {
var config = &GlobalServerConfig{} var config = &GlobalServerConfig{}
config.HTTPAll.SupportsLowVersionHTTP = true config.HTTPAll.SupportsLowVersionHTTP = true
config.HTTPAll.EnableServerAddrVariable = true config.HTTPAll.EnableServerAddrVariable = true
config.HTTPAll.LnRequestSchedulingMethod = LnRequestSchedulingMethodURLMapping
config.HTTPAccessLog.IsOn = true config.HTTPAccessLog.IsOn = true
config.HTTPAccessLog.EnableRequestHeaders = true config.HTTPAccessLog.EnableRequestHeaders = true
@@ -36,11 +45,12 @@ type GlobalServerConfig struct {
DefaultDomain string `yaml:"defaultDomain" json:"defaultDomain"` // 默认的域名 DefaultDomain string `yaml:"defaultDomain" json:"defaultDomain"` // 默认的域名
DomainMismatchAction *DomainMismatchAction `yaml:"domainMismatchAction" json:"domainMismatchAction"` // 不匹配时采取的动作 DomainMismatchAction *DomainMismatchAction `yaml:"domainMismatchAction" json:"domainMismatchAction"` // 不匹配时采取的动作
SupportsLowVersionHTTP bool `yaml:"supportsLowVersionHTTP" json:"supportsLowVersionHTTP"` // 是否启用低版本HTTP SupportsLowVersionHTTP bool `yaml:"supportsLowVersionHTTP" json:"supportsLowVersionHTTP"` // 是否启用低版本HTTP
MatchCertFromAllServers bool `yaml:"matchCertFromAllServers" json:"matchCertFromAllServers"` // 从所有服务中匹配证书(不要轻易开启!) MatchCertFromAllServers bool `yaml:"matchCertFromAllServers" json:"matchCertFromAllServers"` // 从所有服务中匹配证书(不要轻易开启!)
ForceLnRequest bool `yaml:"forceLnRequest" json:"forceLnRequest"` // 强制从Ln请求内容 ForceLnRequest bool `yaml:"forceLnRequest" json:"forceLnRequest"` // 强制从Ln请求内容
ServerName string `yaml:"serverName" json:"serverName"` // Server名称 LnRequestSchedulingMethod LnRequestSchedulingMethod `yaml:"lnRequestSchedulingMethod" json:"lnRequestSchedulingMethod"` // Ln请求调度方法
EnableServerAddrVariable bool `yaml:"enableServerAddrVariable" json:"enableServerAddrVariable"` // 是否支持${serverAddr}变量 ServerName string `yaml:"serverName" json:"serverName"` // Server名称
EnableServerAddrVariable bool `yaml:"enableServerAddrVariable" json:"enableServerAddrVariable"` // 是否支持${serverAddr}变量
} `yaml:"httpAll" json:"httpAll"` // HTTP统一配置 } `yaml:"httpAll" json:"httpAll"` // HTTP统一配置
HTTPAccessLog struct { HTTPAccessLog struct {