refactor NodeInfo

This commit is contained in:
yuzuki999
2023-08-19 20:06:42 +08:00
parent 42e86bf94c
commit 42407d5c62
13 changed files with 333 additions and 391 deletions

View File

@@ -46,7 +46,14 @@ func New(c *conf.ApiConfig) (*Client, error) {
// Check node type
c.NodeType = strings.ToLower(c.NodeType)
switch c.NodeType {
case "v2ray", "trojan", "shadowsocks", "hysteria":
case "v2ray":
c.NodeType = "vmess"
case
"vmess",
"trojan",
"shadowsocks",
"hysteria",
"vless":
default:
return nil, fmt.Errorf("unsupported Node type: %s", c.NodeType)
}