Config: Prefer newer alias (REALITY target, RAW)
Some checks failed
Build docker image / build-image (push) Has been cancelled
Build and Release / prepare (push) Has been cancelled
Test / test (macos-latest) (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
Test / test (windows-latest) (push) Has been cancelled
Build and Release / build (386, freebsd, , ) (push) Has been cancelled
Build and Release / build (386, linux, , ) (push) Has been cancelled
Build and Release / build (386, openbsd, , ) (push) Has been cancelled
Build and Release / build (386, windows, , ) (push) Has been cancelled
Build and Release / build (386, windows, 1.21.4, win7-32) (push) Has been cancelled
Build and Release / build (amd64, darwin, , ) (push) Has been cancelled
Build and Release / build (amd64, freebsd, , ) (push) Has been cancelled
Build and Release / build (amd64, linux, , ) (push) Has been cancelled
Build and Release / build (amd64, openbsd, , ) (push) Has been cancelled
Build and Release / build (amd64, windows, , ) (push) Has been cancelled
Build and Release / build (amd64, windows, 1.21.4, win7-64) (push) Has been cancelled
Build and Release / build (arm, 5, linux) (push) Has been cancelled
Build and Release / build (arm, 6, linux) (push) Has been cancelled
Build and Release / build (arm, 7, freebsd) (push) Has been cancelled
Build and Release / build (arm, 7, linux) (push) Has been cancelled
Build and Release / build (arm, 7, openbsd) (push) Has been cancelled
Build and Release / build (arm, 7, windows) (push) Has been cancelled
Build and Release / build (arm64, android) (push) Has been cancelled
Build and Release / build (arm64, darwin) (push) Has been cancelled
Build and Release / build (arm64, freebsd) (push) Has been cancelled
Build and Release / build (arm64, linux) (push) Has been cancelled
Build and Release / build (arm64, openbsd) (push) Has been cancelled
Build and Release / build (arm64, windows) (push) Has been cancelled
Build and Release / build (loong64, linux) (push) Has been cancelled
Build and Release / build (mips, linux) (push) Has been cancelled
Build and Release / build (mips64, linux) (push) Has been cancelled
Build and Release / build (mips64le, linux) (push) Has been cancelled
Build and Release / build (mipsle, linux) (push) Has been cancelled
Build and Release / build (ppc64, linux) (push) Has been cancelled
Build and Release / build (ppc64le, linux) (push) Has been cancelled
Build and Release / build (riscv64, linux) (push) Has been cancelled
Build and Release / build (s390x, linux) (push) Has been cancelled

This commit is contained in:
RPRX
2024-10-18 02:18:06 +00:00
committed by GitHub
parent 8809cbda81
commit e4939dc1db

View File

@@ -484,10 +484,10 @@ func (c *TLSConfig) Build() (proto.Message, error) {
}
type REALITYConfig struct {
Show bool `json:"show"`
MasterKeyLog string `json:"masterKeyLog"`
Dest json.RawMessage `json:"dest"`
Show bool `json:"show"`
Target json.RawMessage `json:"target"`
Dest json.RawMessage `json:"dest"`
Type string `json:"type"`
Xver uint64 `json:"xver"`
ServerNames []string `json:"serverNames"`
@@ -506,10 +506,10 @@ type REALITYConfig struct {
func (c *REALITYConfig) Build() (proto.Message, error) {
config := new(reality.Config)
config.Show = c.Show
config.MasterKeyLog = c.MasterKeyLog
config.Show = c.Show
var err error
if c.Dest == nil {
if c.Target != nil {
c.Dest = c.Target
}
if c.Dest != nil {
@@ -539,7 +539,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
}
}
if c.Type == "" {
return nil, errors.New(`please fill in a valid value for "dest" or "target"`)
return nil, errors.New(`please fill in a valid value for "target"`)
}
if c.Xver > 2 {
return nil, errors.New(`invalid PROXY protocol version, "xver" only accepts 0, 1, 2`)
@@ -856,7 +856,7 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
default:
return nil, errors.New(`Unknown security "` + c.Security + `".`)
}
if c.TCPSettings == nil {
if c.RAWSettings != nil {
c.TCPSettings = c.RAWSettings
}
if c.TCPSettings != nil {