From 74937cd838087bf257436862fc0651c8bdc5368d Mon Sep 17 00:00:00 2001 From: thh1451 Date: Wed, 17 Jul 2024 11:12:54 +0200 Subject: [PATCH] XTLS only supports TLS and REALITY directly for now in V2RaySocks --- api/v2raysocks/v2raysocks.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/v2raysocks/v2raysocks.go b/api/v2raysocks/v2raysocks.go index c91a5f052..d006ac17a 100644 --- a/api/v2raysocks/v2raysocks.go +++ b/api/v2raysocks/v2raysocks.go @@ -423,6 +423,7 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *simplejson.Json) (* var enableTLS bool var enableVless bool var enableReality bool + var vlessFlow string var alterID uint16 = 0 tmpInboundInfo := nodeInfoResponse.Get("inbounds").MustArray() @@ -470,6 +471,13 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *simplejson.Json) (* } } + // XTLS only supports TLS and REALITY directly for now + if (transportProtocol == "h2" || transportProtocol == "grpc") && enableReality { + vlessFlow = "" + } else { + vlessFlow = c.VlessFlow + } + // Create GeneralNodeInfo // AlterID will be updated after next sync nodeInfo := &api.NodeInfo{ @@ -482,7 +490,7 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *simplejson.Json) (* Path: path, Host: host, EnableVless: enableVless, - VlessFlow: c.VlessFlow, + VlessFlow: vlessFlow, ServiceName: serviceName, Header: header, EnableREALITY: enableReality,