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.
This commit is contained in:
Takeshi Matsumoto
2025-08-16 03:08:56 +09:00
parent f86dd89cdd
commit c38fd1b7b7

View File

@@ -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'),