mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 20:40:25 +08:00
支持PROXY Protocol
This commit is contained in:
@@ -41,6 +41,8 @@ type ReverseProxyConfig struct {
|
||||
|
||||
AutoFlush bool `yaml:"autoFlush" json:"autoFlush"` // 是否自动刷新缓冲区,在比如SSE(server-sent events)场景下很有用
|
||||
|
||||
ProxyProtocol *ProxyProtocolConfig `yaml:"proxyProtocol" json:"proxyProtocol"`
|
||||
|
||||
requestHostHasVariables bool
|
||||
requestURIHasVariables bool
|
||||
|
||||
@@ -171,6 +173,14 @@ func (this *ReverseProxyConfig) Init() error {
|
||||
this.addXForwardedProtoHeader = lists.ContainsString(this.AddHeaders, "X-Forwarded-Proto")
|
||||
}
|
||||
|
||||
// PROXY Protocol
|
||||
if this.ProxyProtocol != nil {
|
||||
err := this.ProxyProtocol.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user