From f86dd89cdd2064ccf117060cfff94cbdc4f3647d Mon Sep 17 00:00:00 2001 From: Takeshi Matsumoto Date: Sat, 16 Aug 2025 02:44:17 +0900 Subject: [PATCH 1/3] fix: correct SNI domain configuration paths in SingBox protocol - Fix Trojan protocol to use 'server_name' instead of 'tls_settings.server_name' - Fix Hysteria protocol to use 'tls.server_name' instead of 'tls_settings.server_name' - Align with Server model configuration and General protocol implementation - Resolves missing SNI domains in sing-box configuration generation This fixes the inconsistency where SNI domains were missing for certain protocols while working correctly in General protocol handler. --- 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 ae0a4e9..b50e66d 100644 --- a/app/Protocols/SingBox.php +++ b/app/Protocols/SingBox.php @@ -310,7 +310,7 @@ class SingBox extends AbstractProtocol 'insecure' => (bool) data_get($protocol_settings, 'allow_insecure', false), ] ]; - if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) { + if ($serverName = data_get($protocol_settings, 'server_name')) { $array['tls']['server_name'] = $serverName; } $transport = match (data_get($protocol_settings, 'network')) { @@ -353,7 +353,7 @@ class SingBox extends AbstractProtocol } } - if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) { + if ($serverName = data_get($protocol_settings, 'tls.server_name')) { $baseConfig['tls']['server_name'] = $serverName; } $speedConfig = [ From c38fd1b7b7acc64e964c1bea38d6741c8a2a0fdd Mon Sep 17 00:00:00 2001 From: Takeshi Matsumoto Date: Sat, 16 Aug 2025 03:08:56 +0900 Subject: [PATCH 2/3] 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'),