This commit is contained in:
yuzuki999 2023-08-30 15:34:37 +08:00
parent 7952d219df
commit 5cf0d7c783
2 changed files with 17 additions and 5 deletions

View File

@ -58,11 +58,13 @@ type BaseConfig struct {
// VAllssNode is vmess and vless node info
type VAllssNode struct {
CommonNode
Tls int `json:"tls"`
TlsSettings TlsSettings `json:"tls_settings"`
Network string `json:"network"`
NetworkSettings json.RawMessage `json:"network_settings"`
ServerName string `json:"server_name"`
Tls int `json:"tls"`
TlsSettings TlsSettings `json:"tls_settings"`
TlsSettingsBack *TlsSettings `json:"tlsSettings"`
Network string `json:"network"`
NetworkSettings json.RawMessage `json:"network_settings"`
NetworkSettingsBack json.RawMessage `json:"networkSettings"`
ServerName string `json:"server_name"`
// vless only
Flow string `json:"flow"`
@ -137,6 +139,14 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
if err != nil {
return nil, fmt.Errorf("decode v2ray params error: %s", err)
}
if len(rsp.NetworkSettingsBack) > 0 {
rsp.NetworkSettings = rsp.NetworkSettingsBack
rsp.NetworkSettingsBack = nil
}
if rsp.TlsSettingsBack != nil {
rsp.TlsSettings = *rsp.TlsSettingsBack
rsp.TlsSettingsBack = nil
}
cm = &rsp.CommonNode
node.VAllss = rsp
node.Security = node.VAllss.Tls

View File

@ -27,8 +27,10 @@ func buildInbound(option *conf.Options, nodeInfo *panel.NodeInfo, tag string) (*
network = nodeInfo.VAllss.Network
case "trojan":
err = buildTrojan(option, in)
network = "tcp"
case "shadowsocks":
err = buildShadowsocks(option, nodeInfo, in)
network = "tcp"
default:
return nil, fmt.Errorf("unsupported node type: %s, Only support: V2ray, Trojan, Shadowsocks", nodeInfo.Type)
}