diff --git a/app/Protocols/Shadowrocket.php b/app/Protocols/Shadowrocket.php index 6c4ec0b..7fdf5fc 100644 --- a/app/Protocols/Shadowrocket.php +++ b/app/Protocols/Shadowrocket.php @@ -199,6 +199,34 @@ class Shadowrocket extends AbstractProtocol $config['path'] = data_get($protocol_settings, 'network_settings.serviceName'); $config['host'] = data_get($protocol_settings, 'tls_settings.server_name') ?? $server['host']; break; + case 'kcp': + $config['obfs'] = "kcp"; + if ($seed = data_get($protocol_settings, 'network_settings.seed')) { + $config['path'] = $seed; + } + $config['type'] = data_get($protocol_settings, 'network_settings.header.type', 'none'); + break; + case 'httpupgrade': + $config['obfs'] = "httpupgrade"; + if ($path = data_get($protocol_settings, 'network_settings.path')) { + $config['path'] = $path; + } + if ($host = data_get($protocol_settings, 'network_settings.host', $server['host'])) { + $config['obfsParam'] = $host; + } + break; + case 'xhttp': + $config['obfs'] = "xhttp"; + if ($path = data_get($protocol_settings, 'network_settings.path')) { + $config['path'] = $path; + } + if ($host = data_get($protocol_settings, 'network_settings.host', $server['host'])) { + $config['obfsParam'] = $host; + } + if ($mode = data_get($protocol_settings, 'network_settings.mode', 'auto')) { + $config['mode'] = $mode; + } + break; } $query = http_build_query($config, '', '&', PHP_QUERY_RFC3986);