fix proxy protocol not work

This commit is contained in:
Yuzuki999 2022-12-19 16:26:02 +08:00
parent 695da4f4c5
commit bb430dbb8d

View File

@ -50,7 +50,7 @@ func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
sniffingConfig.Enabled = false
}
inbound.SniffingConfig = sniffingConfig
if nodeInfo.NodeType == "tcp" {
if *inbound.StreamSetting.Network == "tcp" {
if inbound.StreamSetting.TCPSettings != nil {
inbound.StreamSetting.TCPSettings.AcceptProxyProtocol = config.EnableProxyProtocol
} else {
@ -59,7 +59,7 @@ func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
} //Enable proxy protocol
inbound.StreamSetting.TCPSettings = tcpSetting
}
} else if nodeInfo.NodeType == "ws" {
} else if *inbound.StreamSetting.Network == "ws" {
inbound.StreamSetting.WSSettings = &coreConf.WebSocketConfig{
AcceptProxyProtocol: config.EnableProxyProtocol} //Enable proxy protocol
}