mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 18:48:14 -05:00
Protocol Shadowrocket: fixed Vmess + TCP multiple bugs
This commit is contained in:
parent
3b9cc99526
commit
6d46ecb757
@ -96,8 +96,11 @@ class Shadowrocket implements ProtocolInterface
|
|||||||
|
|
||||||
switch (data_get($protocol_settings, 'network')) {
|
switch (data_get($protocol_settings, 'network')) {
|
||||||
case 'tcp':
|
case 'tcp':
|
||||||
$config['obfs'] = data_get($protocol_settings, 'network_settings.header.type');
|
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['obfs'] = data_get($protocol_settings, 'network_settings.header.type');
|
||||||
|
$config['path'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']));
|
||||||
|
$config['obfsParam'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.headers.Host', ['www.example.com']));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'ws':
|
case 'ws':
|
||||||
$config['obfs'] = "websocket";
|
$config['obfs'] = "websocket";
|
||||||
@ -161,13 +164,18 @@ class Shadowrocket implements ProtocolInterface
|
|||||||
}
|
}
|
||||||
switch (data_get($protocol_settings, 'network')) {
|
switch (data_get($protocol_settings, 'network')) {
|
||||||
case 'tcp':
|
case 'tcp':
|
||||||
$config['obfs'] = data_get($protocol_settings, 'network_settings.header.type');
|
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['obfs'] = data_get($protocol_settings, 'network_settings.header.type');
|
||||||
$config['obfsParam'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.headers.Host', ['/']));
|
$config['path'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.path', ['/']));
|
||||||
|
$config['obfsParam'] = \Arr::random(data_get($protocol_settings, 'network_settings.header.request.headers.Host', ['www.example.com']));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'ws':
|
case 'ws':
|
||||||
$config['obfs'] = "websocket";
|
$config['obfs'] = "websocket";
|
||||||
$config['path'] = data_get($protocol_settings, 'network_settings.path');
|
if (data_get($protocol_settings, 'network_settings.path')) {
|
||||||
|
$config['path'] = data_get($protocol_settings, 'network_settings.path');
|
||||||
|
}
|
||||||
|
|
||||||
if ($host = data_get($protocol_settings, 'network_settings.headers.Host')) {
|
if ($host = data_get($protocol_settings, 'network_settings.headers.Host')) {
|
||||||
$config['obfsParam'] = $host;
|
$config['obfsParam'] = $host;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user