mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 12:07:28 +08:00
fix: resolve vmess http-opts headers null issue in subscription generation
This commit is contained in:
@@ -314,7 +314,12 @@ class Stash extends AbstractProtocol
|
||||
case 'tcp':
|
||||
if ($headerType = data_get($protocol_settings, 'network_settings.header.type', 'tcp') != 'tcp') {
|
||||
$array['network'] = $headerType;
|
||||
$array['http-opts']['path'] = data_get($protocol_settings, 'network_settings.header.request.path', ['/']);
|
||||
if ($httpOpts = array_filter([
|
||||
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
||||
'path' => data_get($protocol_settings, 'network_settings.header.request.path', ['/'])
|
||||
])) {
|
||||
$array['http-opts'] = $httpOpts;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'ws':
|
||||
@@ -356,7 +361,9 @@ class Stash extends AbstractProtocol
|
||||
case 'ws':
|
||||
$array['network'] = 'ws';
|
||||
$array['ws-opts']['path'] = data_get($protocol_settings, 'network_settings.path');
|
||||
$array['ws-opts']['headers'] = data_get($protocol_settings, 'network_settings.headers.Host') ? ['Host' => data_get($protocol_settings, 'network_settings.headers.Host')] : null;
|
||||
if ($host = data_get($protocol_settings, 'network_settings.headers.Host')) {
|
||||
$array['ws-opts']['headers'] = ['Host' => $host];
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ($serverName = data_get($protocol_settings, 'server_name')) {
|
||||
|
||||
Reference in New Issue
Block a user