mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-02-08 18:08:13 -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')) {
|
switch (data_get($protocol_settings, 'network')) {
|
||||||
case 'tcp':
|
case 'tcp':
|
||||||
$array['network'] = data_get($protocol_settings, 'network_settings.header.type');
|
$array['network'] = data_get($protocol_settings, 'network_settings.header.type');
|
||||||
$array['http-opts'] = [
|
if (data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none') {
|
||||||
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
$array['http-opts'] = [
|
||||||
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']))
|
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
||||||
];
|
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']))
|
||||||
|
];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'ws':
|
case 'ws':
|
||||||
$array['network'] = 'ws';
|
$array['network'] = 'ws';
|
||||||
|
@ -158,10 +158,12 @@ class ClashMeta implements ProtocolInterface
|
|||||||
switch (data_get($protocol_settings, 'network')) {
|
switch (data_get($protocol_settings, 'network')) {
|
||||||
case 'tcp':
|
case 'tcp':
|
||||||
$array['network'] = data_get($protocol_settings, 'network_settings.header.type', 'tcp');
|
$array['network'] = data_get($protocol_settings, 'network_settings.header.type', 'tcp');
|
||||||
$array['http-opts'] = [
|
if (data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none') {
|
||||||
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
$array['http-opts'] = [
|
||||||
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']), 1)
|
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
|
||||||
];
|
'path' => \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']))
|
||||||
|
];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'ws':
|
case 'ws':
|
||||||
$array['network'] = 'ws';
|
$array['network'] = 'ws';
|
||||||
|
@ -82,9 +82,11 @@ class General implements ProtocolInterface
|
|||||||
|
|
||||||
switch ($protocol_settings['network']) {
|
switch ($protocol_settings['network']) {
|
||||||
case 'tcp':
|
case 'tcp':
|
||||||
$config['type'] = 'http';
|
if (data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none') {
|
||||||
$config['path'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']));
|
$config['type'] = data_get($protocol_settings, 'network_settings.header.type', 'http');
|
||||||
$config['host'] = data_get($protocol_settings, 'network_settings.headers.Host') ? \Arr::random(data_get($protocol_settings, 'network_settings.headers.Host'),['/']) : null;
|
$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;
|
break;
|
||||||
case 'ws':
|
case 'ws':
|
||||||
$config['type'] = 'ws';
|
$config['type'] = 'ws';
|
||||||
|
Loading…
Reference in New Issue
Block a user