mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:38:50 +02:00
refactor(config): add SupportProxyProtocol to Entrypoint config
This commit is contained in:
@@ -204,12 +204,13 @@ func (cfg *Config) StartServers(opts ...*StartServersOptions) {
|
|||||||
opt := opts[0]
|
opt := opts[0]
|
||||||
if opt.Proxy {
|
if opt.Proxy {
|
||||||
server.StartServer(cfg.task, server.Options{
|
server.StartServer(cfg.task, server.Options{
|
||||||
Name: "proxy",
|
Name: "proxy",
|
||||||
CertProvider: cfg.AutoCertProvider(),
|
CertProvider: cfg.AutoCertProvider(),
|
||||||
HTTPAddr: common.ProxyHTTPAddr,
|
HTTPAddr: common.ProxyHTTPAddr,
|
||||||
HTTPSAddr: common.ProxyHTTPSAddr,
|
HTTPSAddr: common.ProxyHTTPSAddr,
|
||||||
Handler: cfg.entrypoint,
|
Handler: cfg.entrypoint,
|
||||||
ACL: cfg.value.ACL,
|
ACL: cfg.value.ACL,
|
||||||
|
SupportProxyProtocol: cfg.value.Entrypoint.SupportProxyProtocol,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if opt.API {
|
if opt.API {
|
||||||
|
|||||||
@@ -37,8 +37,9 @@ type (
|
|||||||
MaxMind *maxmind.Config `json:"maxmind" yaml:"maxmind,omitempty"`
|
MaxMind *maxmind.Config `json:"maxmind" yaml:"maxmind,omitempty"`
|
||||||
}
|
}
|
||||||
Entrypoint struct {
|
Entrypoint struct {
|
||||||
Middlewares []map[string]any `json:"middlewares"`
|
SupportProxyProtocol bool `json:"support_proxy_protocol"`
|
||||||
AccessLog *accesslog.RequestLoggerConfig `json:"access_log" validate:"omitempty"`
|
Middlewares []map[string]any `json:"middlewares"`
|
||||||
|
AccessLog *accesslog.RequestLoggerConfig `json:"access_log" validate:"omitempty"`
|
||||||
}
|
}
|
||||||
HomepageConfig struct {
|
HomepageConfig struct {
|
||||||
UseDefaultCategories bool `json:"use_default_categories"`
|
UseDefaultCategories bool `json:"use_default_categories"`
|
||||||
|
|||||||
Reference in New Issue
Block a user