mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
Merge pull request #308 from NekoCareLab/new
Fixed Vmess TCP for General and Clash/ClashMeta
This commit is contained in:
commit
efe8c2a96d
@ -159,10 +159,12 @@ class Clash implements ProtocolInterface
|
||||
switch (data_get($protocol_settings, 'network')) {
|
||||
case 'tcp':
|
||||
$array['network'] = data_get($protocol_settings, 'network_settings.header.type');
|
||||
$array['http-opts'] = [
|
||||
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
||||
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']))
|
||||
];
|
||||
if (data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none') {
|
||||
$array['http-opts'] = [
|
||||
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
||||
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']))
|
||||
];
|
||||
}
|
||||
break;
|
||||
case 'ws':
|
||||
$array['network'] = 'ws';
|
||||
|
@ -158,10 +158,12 @@ class ClashMeta implements ProtocolInterface
|
||||
switch (data_get($protocol_settings, 'network')) {
|
||||
case 'tcp':
|
||||
$array['network'] = data_get($protocol_settings, 'network_settings.header.type', 'tcp');
|
||||
$array['http-opts'] = [
|
||||
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
||||
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']), 1)
|
||||
];
|
||||
if (data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none') {
|
||||
$array['http-opts'] = [
|
||||
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
||||
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']))
|
||||
];
|
||||
}
|
||||
break;
|
||||
case 'ws':
|
||||
$array['network'] = 'ws';
|
||||
|
@ -82,9 +82,11 @@ class General implements ProtocolInterface
|
||||
|
||||
switch ($protocol_settings['network']) {
|
||||
case 'tcp':
|
||||
$config['type'] = 'http';
|
||||
$config['path'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']));
|
||||
$config['host'] = data_get($protocol_settings, 'network_settings.headers.Host') ? \Arr::random(data_get($protocol_settings, 'network_settings.headers.Host'),['/']) : null;
|
||||
if (data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none') {
|
||||
$config['type'] = data_get($protocol_settings, 'network_settings.header.type', 'http');
|
||||
$config['path'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']));
|
||||
$config['host'] = data_get($protocol_settings, 'network_settings.headers.Host') ? \Arr::random(data_get($protocol_settings, 'network_settings.headers.Host'), ['/']) : null;
|
||||
}
|
||||
break;
|
||||
case 'ws':
|
||||
$config['type'] = 'ws';
|
||||
|
Loading…
Reference in New Issue
Block a user