mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
test: add anytls
This commit is contained in:
@@ -33,6 +33,7 @@ type NodeInfo struct {
|
||||
Shadowsocks *ShadowsocksNode
|
||||
Trojan *TrojanNode
|
||||
Tuic *TuicNode
|
||||
AnyTls *AnyTlsNode
|
||||
Hysteria *HysteriaNode
|
||||
Hysteria2 *Hysteria2Node
|
||||
Common *CommonNode
|
||||
@@ -107,6 +108,11 @@ type TuicNode struct {
|
||||
ZeroRTTHandshake bool `json:"zero_rtt_handshake"`
|
||||
}
|
||||
|
||||
type AnyTlsNode struct {
|
||||
CommonNode
|
||||
PaddingScheme []string `json:"padding_scheme,omitempty"`
|
||||
}
|
||||
|
||||
type HysteriaNode struct {
|
||||
CommonNode
|
||||
UpMbps int `json:"up_mbps"`
|
||||
@@ -219,6 +225,15 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
|
||||
cm = &rsp.CommonNode
|
||||
node.Tuic = rsp
|
||||
node.Security = Tls
|
||||
case "anytls":
|
||||
rsp := &AnyTlsNode{}
|
||||
err = json.Unmarshal(r.Body(), rsp)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decode anytls params error: %s", err)
|
||||
}
|
||||
cm = &rsp.CommonNode
|
||||
node.AnyTls = rsp
|
||||
node.Security = Tls
|
||||
case "hysteria":
|
||||
rsp := &HysteriaNode{}
|
||||
err = json.Unmarshal(r.Body(), rsp)
|
||||
|
||||
@@ -57,6 +57,7 @@ func New(c *conf.ApiConfig) (*Client, error) {
|
||||
"hysteria",
|
||||
"hysteria2",
|
||||
"tuic",
|
||||
"anytls",
|
||||
"vless":
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported Node type: %s", c.NodeType)
|
||||
|
||||
Reference in New Issue
Block a user