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

Merge pull request #13 from remann2/dev

fix: reality parsing
This commit is contained in:
Nite07 2024-02-19 11:45:30 +08:00 committed by GitHub
commit 9860c3fa53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 13 deletions

View File

@ -16,8 +16,8 @@ type GrpcOptions struct {
} }
type RealityOptions struct { type RealityOptions struct {
PublicKey string `proxy:"public-key"` PublicKey string `yaml:"public-key"`
ShortID string `proxy:"short-id"` ShortID string `yaml:"short-id,omitempty"`
} }
type WSOptions struct { type WSOptions struct {

View File

@ -36,17 +36,17 @@ func ParseVless(proxy string) (model.Proxy, error) {
} }
// 返回结果 // 返回结果
result := model.Proxy{ result := model.Proxy{
Type: "vless", Type: "vless",
Server: strings.TrimSpace(serverAndPort[0]), Server: strings.TrimSpace(serverAndPort[0]),
Port: port, Port: port,
UUID: strings.TrimSpace(parts[0]), UUID: strings.TrimSpace(parts[0]),
UDP: true, UDP: true,
Sni: params.Get("sni"), Sni: params.Get("sni"),
Network: params.Get("type"), Network: params.Get("type"),
TLS: params.Get("security") == "tls", TLS: params.Get("security") == "reality",
Flow: params.Get("flow"), Flow: params.Get("flow"),
Fingerprint: params.Get("fp"), ClientFingerprint: params.Get("fp"),
Servername: params.Get("sni"), Servername: params.Get("sni"),
RealityOpts: model.RealityOptions{ RealityOpts: model.RealityOptions{
PublicKey: params.Get("pbk"), PublicKey: params.Get("pbk"),
}, },