mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
Add PROXY Protocol support for freedom outbound
This commit is contained in:
parent
b56917fde5
commit
3a99520370
5 changed files with 80 additions and 22 deletions
|
@ -17,6 +17,7 @@ type FreedomConfig struct {
|
|||
Redirect string `json:"redirect"`
|
||||
UserLevel uint32 `json:"userLevel"`
|
||||
Fragment *Fragment `json:"fragment"`
|
||||
ProxyProtocol uint32 `json:"proxyProtocol"`
|
||||
}
|
||||
|
||||
type Fragment struct {
|
||||
|
@ -165,5 +166,8 @@ func (c *FreedomConfig) Build() (proto.Message, error) {
|
|||
config.DestinationOverride.Server.Address = v2net.NewIPOrDomain(v2net.ParseAddress(host))
|
||||
}
|
||||
}
|
||||
if c.ProxyProtocol > 0 && c.ProxyProtocol <= 2 {
|
||||
config.ProxyProtocol = c.ProxyProtocol
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue