From c38fd1b7b7acc64e964c1bea38d6741c8a2a0fdd Mon Sep 17 00:00:00 2001 From: Takeshi Matsumoto Date: Sat, 16 Aug 2025 03:08:56 +0900 Subject: [PATCH] fix: correct VMess TCP transport configuration in SingBox protocol - Only add HTTP transport when network_settings.header.type is not 'none' - Use pure TCP (null transport) when header type is 'none' or unset - Align with General protocol implementation and VMess specification This prevents unnecessary HTTP transport layer when using pure TCP. --- app/Protocols/SingBox.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Protocols/SingBox.php b/app/Protocols/SingBox.php index b50e66d..dcc0704 100644 --- a/app/Protocols/SingBox.php +++ b/app/Protocols/SingBox.php @@ -193,10 +193,10 @@ class SingBox extends AbstractProtocol } $transport = match ($protocol_settings['network']) { - 'tcp' => [ + 'tcp' => data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none' ? [ 'type' => 'http', 'path' => Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/'])) - ], + ] : null, 'ws' => [ 'type' => 'ws', 'path' => data_get($protocol_settings, 'network_settings.path'),