尝试添加trojan的ws/grpc传输

This commit is contained in:
wyx2685
2023-12-19 00:17:16 +09:00
parent 1f6cccbb9f
commit d19ca6863e
4 changed files with 85 additions and 32 deletions

View File

@@ -94,7 +94,11 @@ type ShadowsocksNode struct {
ServerKey string `json:"server_key"`
}
type TrojanNode CommonNode
type TrojanNode struct {
CommonNode
Network string `json:"network"`
NetworkSettings json.RawMessage `json:"networkSettings"`
}
type HysteriaNode struct {
CommonNode
@@ -188,7 +192,7 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
if err != nil {
return nil, fmt.Errorf("decode trojan params error: %s", err)
}
cm = (*CommonNode)(rsp)
cm = &rsp.CommonNode
node.Trojan = rsp
node.Security = Tls
case "hysteria":