mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 21:54:42 -05:00
fix: 修复 vmess/vless 节点名称未URL解码的问题
This commit is contained in:
parent
679102fa3b
commit
70f5c63fe2
@ -72,10 +72,16 @@ func ParseVless(proxy string) (model.Proxy, error) {
|
||||
if strings.Contains(serverInfo[1], "|") {
|
||||
result.Name = strings.SplitN(serverInfo[1], "|", 2)[1]
|
||||
} else {
|
||||
result.Name = serverInfo[1]
|
||||
result.Name, err = url.QueryUnescape(serverInfo[1])
|
||||
if err != nil {
|
||||
return model.Proxy{}, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result.Name = serverAndPort[0]
|
||||
result.Name, err = url.QueryUnescape(serverAndPort[0])
|
||||
if err != nil {
|
||||
return model.Proxy{}, err
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package parser
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sub2clash/model"
|
||||
@ -56,9 +57,13 @@ func ParseVmess(proxy string) (model.Proxy, error) {
|
||||
if vmess.Net == "ws" && vmess.Host == "" {
|
||||
vmess.Host = vmess.Add
|
||||
}
|
||||
name, err := url.QueryUnescape(vmess.Ps)
|
||||
if err != nil {
|
||||
name = vmess.Ps
|
||||
}
|
||||
// 返回结果
|
||||
result := model.Proxy{
|
||||
Name: vmess.Ps,
|
||||
Name: name,
|
||||
Type: "vmess",
|
||||
Server: vmess.Add,
|
||||
Port: port,
|
||||
|
Loading…
Reference in New Issue
Block a user