1
0
mirror of https://github.com/nitezs/sub2clash.git synced 2024-12-23 15:24:42 -05:00

fix vless reality parsing

This commit is contained in:
Zongxin Gan 2024-02-18 18:25:57 +08:00
parent 50877b1691
commit 46e2e3af61
2 changed files with 13 additions and 13 deletions

View File

@ -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 {

View File

@ -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"),
},