mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 08:31:28 +00:00
REALITY config: Add target
as an alias of dest
https://t.me/projectXtls/364
This commit is contained in:
parent
c7534c4e36
commit
75729ce779
|
@ -474,6 +474,7 @@ type REALITYConfig struct {
|
||||||
Show bool `json:"show"`
|
Show bool `json:"show"`
|
||||||
MasterKeyLog string `json:"masterKeyLog"`
|
MasterKeyLog string `json:"masterKeyLog"`
|
||||||
Dest json.RawMessage `json:"dest"`
|
Dest json.RawMessage `json:"dest"`
|
||||||
|
Target json.RawMessage `json:"target"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Xver uint64 `json:"xver"`
|
Xver uint64 `json:"xver"`
|
||||||
ServerNames []string `json:"serverNames"`
|
ServerNames []string `json:"serverNames"`
|
||||||
|
@ -495,6 +496,9 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
|
||||||
config.Show = c.Show
|
config.Show = c.Show
|
||||||
config.MasterKeyLog = c.MasterKeyLog
|
config.MasterKeyLog = c.MasterKeyLog
|
||||||
var err error
|
var err error
|
||||||
|
if c.Dest == nil {
|
||||||
|
c.Dest = c.Target
|
||||||
|
}
|
||||||
if c.Dest != nil {
|
if c.Dest != nil {
|
||||||
var i uint16
|
var i uint16
|
||||||
var s string
|
var s string
|
||||||
|
@ -522,7 +526,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c.Type == "" {
|
if c.Type == "" {
|
||||||
return nil, errors.New(`please fill in a valid value for "dest"`)
|
return nil, errors.New(`please fill in a valid value for "dest" or "target"`)
|
||||||
}
|
}
|
||||||
if c.Xver > 2 {
|
if c.Xver > 2 {
|
||||||
return nil, errors.New(`invalid PROXY protocol version, "xver" only accepts 0, 1, 2`)
|
return nil, errors.New(`invalid PROXY protocol version, "xver" only accepts 0, 1, 2`)
|
||||||
|
|
Loading…
Reference in a new issue