mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
test: Add Tuic
This commit is contained in:
@@ -32,6 +32,7 @@ type NodeInfo struct {
|
||||
VAllss *VAllssNode
|
||||
Shadowsocks *ShadowsocksNode
|
||||
Trojan *TrojanNode
|
||||
Tuic *TuicNode
|
||||
Hysteria *HysteriaNode
|
||||
Hysteria2 *Hysteria2Node
|
||||
Common *CommonNode
|
||||
@@ -100,6 +101,12 @@ type TrojanNode struct {
|
||||
NetworkSettings json.RawMessage `json:"networkSettings"`
|
||||
}
|
||||
|
||||
type TuicNode struct {
|
||||
CommonNode
|
||||
CongestionControl string `json:"congestion_control"`
|
||||
ZeroRTTHandshake bool `json:"zero_rtt_handshake"`
|
||||
}
|
||||
|
||||
type HysteriaNode struct {
|
||||
CommonNode
|
||||
UpMbps int `json:"up_mbps"`
|
||||
@@ -203,6 +210,15 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
|
||||
cm = &rsp.CommonNode
|
||||
node.Trojan = rsp
|
||||
node.Security = Tls
|
||||
case "tuic":
|
||||
rsp := &TuicNode{}
|
||||
err = json.Unmarshal(r.Body(), rsp)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decode tuic params error: %s", err)
|
||||
}
|
||||
cm = &rsp.CommonNode
|
||||
node.Tuic = rsp
|
||||
node.Security = Tls
|
||||
case "hysteria":
|
||||
rsp := &HysteriaNode{}
|
||||
err = json.Unmarshal(r.Body(), rsp)
|
||||
|
||||
Reference in New Issue
Block a user