Skip to content

Commit

Permalink
fix: vless ws 解析缺失 TLS 字段
Browse files Browse the repository at this point in the history
  • Loading branch information
nitezs committed Mar 12, 2024
1 parent 0681f59 commit 1d9de31
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions parser/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@ func ParseVless(proxy string) (model.Proxy, error) {
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"),
ShortID: params.Get("sid"),
},
}
if params.Get("alpn") != "" {
result.Alpn = strings.Split(params.Get("alpn"), ",")
}
if params.Get("security") == "reality" {
result.TLS = true
result.RealityOpts = model.RealityOptions{
PublicKey: params.Get("pbk"),
ShortID: params.Get("sid"),
}
}
if params.Get("type") == "ws" {
result.TLS = true
result.WSOpts = model.WSOptions{
Path: params.Get("path"),
Headers: map[string]string{
Expand All @@ -64,6 +67,7 @@ func ParseVless(proxy string) (model.Proxy, error) {
}
}
if params.Get("type") == "grpc" {
result.TLS = true
result.GrpcOpts = model.GrpcOptions{
GrpcServiceName: params.Get("serviceName"),
}
Expand Down

0 comments on commit 1d9de31

Please sign in to comment.