Skip to content

Commit

Permalink
Merge pull request #13 from remann2/dev
Browse files Browse the repository at this point in the history
fix: reality parsing
  • Loading branch information
nitezs authored Feb 19, 2024
2 parents fd8164b + b053281 commit 9860c3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions model/proxy_vmess.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type GrpcOptions struct {
}

type RealityOptions struct {
PublicKey string `proxy:"public-key"`
ShortID string `proxy:"short-id"`
PublicKey string `yaml:"public-key"`
ShortID string `yaml:"short-id,omitempty"`
}

type WSOptions struct {
Expand Down
22 changes: 11 additions & 11 deletions parser/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ func ParseVless(proxy string) (model.Proxy, error) {
}
// 返回结果
result := model.Proxy{
Type: "vless",
Server: strings.TrimSpace(serverAndPort[0]),
Port: port,
UUID: strings.TrimSpace(parts[0]),
UDP: true,
Sni: params.Get("sni"),
Network: params.Get("type"),
TLS: params.Get("security") == "tls",
Flow: params.Get("flow"),
Fingerprint: params.Get("fp"),
Servername: params.Get("sni"),
Type: "vless",
Server: strings.TrimSpace(serverAndPort[0]),
Port: port,
UUID: strings.TrimSpace(parts[0]),
UDP: true,
Sni: params.Get("sni"),
Network: params.Get("type"),
TLS: params.Get("security") == "reality",
Flow: params.Get("flow"),
ClientFingerprint: params.Get("fp"),
Servername: params.Get("sni"),
RealityOpts: model.RealityOptions{
PublicKey: params.Get("pbk"),
},
Expand Down

0 comments on commit 9860c3f

Please sign in to comment.