mirror of
https://github.com/v2board/v2board.git
synced 2025-07-03 18:43:22 +08:00
为vless订阅链接增加转义。
This commit is contained in:
@ -104,7 +104,7 @@ class V2rayN
|
||||
{
|
||||
$config = [
|
||||
"v" => "2",
|
||||
"ps" => $server['name'],
|
||||
"ps" => Helper::encodeURIComponent($server['name']),
|
||||
"add" => $server['host'],
|
||||
"port" => (string)$server['port'],
|
||||
"id" => $uuid,
|
||||
@ -132,12 +132,12 @@ class V2rayN
|
||||
if ((string)$server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['network_settings'];
|
||||
if (isset($tcpSettings['header']['type'])) $config['type'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $config['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $config['path'] = Helper::encodeURIComponent($tcpSettings['header']['request']['path'][0]);
|
||||
}
|
||||
if ((string)$server['network'] === 'ws') {
|
||||
$wsSettings = $server['network_settings'];
|
||||
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];
|
||||
if (isset($wsSettings['headers']['Host'])) $config['host'] = $wsSettings['headers']['Host'];
|
||||
if (isset($wsSettings['path'])) $config['path'] = Helper::encodeURIComponent($wsSettings['path']);
|
||||
if (isset($wsSettings['headers']['Host'])) $config['host'] = Helper::encodeURIComponent($wsSettings['headers']['Host']);
|
||||
}
|
||||
if ((string)$server['network'] === 'grpc') {
|
||||
$grpcSettings = $server['network_settings'];
|
||||
@ -146,7 +146,6 @@ class V2rayN
|
||||
//grpc需要继续修
|
||||
if ($server['tls'] == 2) {
|
||||
return "vless://{$uuid}@{$config['add']}:{$server['port']}?type={$config['net']}&encryption=none&security={$config['tls']}&path={$config['path']}&host={$config['host']}&headerType={$config['type']}&flow={$server['flow']}&fp=chrome&sni={$config['sni']}&pbk={$config['pbk']}&sid={$config['sid']}#${config['ps']}" . "\r\n";
|
||||
|
||||
}
|
||||
return "vless://{$uuid}@{$config['add']}:{$server['port']}?type={$config['net']}&encryption=none&security={$config['tls']}&path={$config['path']}&host={$config['host']}&headerType={$config['type']}&flow={$server['flow']}&fp=chrome&sni={$config['sni']}#${config['ps']}" . "\r\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user