mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 00:29:09 +08:00
protocols: fix gRPC protocol serviceName field
fix anXray serverName filed
This commit is contained in:
parent
ad8e2b8e80
commit
bd2b056fbf
@ -64,8 +64,14 @@ class AnXray
|
|||||||
"encryption" => "none",
|
"encryption" => "none",
|
||||||
"type" => urlencode($server['network']),
|
"type" => urlencode($server['network']),
|
||||||
"security" => $server['tls'] ? "tls" : "",
|
"security" => $server['tls'] ? "tls" : "",
|
||||||
"sni" => $server['tls'] ? urlencode(json_decode($server['tlsSettings'], true)['serverName']) : ""
|
|
||||||
];
|
];
|
||||||
|
if ($server['tls']) {
|
||||||
|
if ($server['tlsSettings']) {
|
||||||
|
$tlsSettings = json_decode($server['tlsSettings'], true);
|
||||||
|
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
|
||||||
|
$config['sni'] = urlencode($tlsSettings['serverName']);
|
||||||
|
}
|
||||||
|
}
|
||||||
if ((string)$server['network'] === 'ws') {
|
if ((string)$server['network'] === 'ws') {
|
||||||
$wsSettings = json_decode($server['networkSettings'], true);
|
$wsSettings = json_decode($server['networkSettings'], true);
|
||||||
if (isset($wsSettings['path'])) $config['path'] = urlencode($wsSettings['path']);
|
if (isset($wsSettings['path'])) $config['path'] = urlencode($wsSettings['path']);
|
||||||
|
@ -75,7 +75,7 @@ class Passwall
|
|||||||
}
|
}
|
||||||
if ((string)$server['network'] === 'grpc') {
|
if ((string)$server['network'] === 'grpc') {
|
||||||
$grpcSettings = json_decode($server['networkSettings'], true);
|
$grpcSettings = json_decode($server['networkSettings'], true);
|
||||||
if (isset($grpcSettings['path'])) $config['path'] = $grpcSettings['serviceName'];
|
if (isset($grpcSettings['serviceName'])) $config['path'] = $grpcSettings['serviceName'];
|
||||||
}
|
}
|
||||||
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class SSRPlus
|
|||||||
}
|
}
|
||||||
if ((string)$server['network'] === 'grpc') {
|
if ((string)$server['network'] === 'grpc') {
|
||||||
$grpcSettings = json_decode($server['networkSettings'], true);
|
$grpcSettings = json_decode($server['networkSettings'], true);
|
||||||
if (isset($grpcSettings['path'])) $config['path'] = $grpcSettings['serviceName'];
|
if (isset($grpcSettings['serviceName'])) $config['path'] = $grpcSettings['serviceName'];
|
||||||
}
|
}
|
||||||
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class V2rayN
|
|||||||
}
|
}
|
||||||
if ((string)$server['network'] === 'grpc') {
|
if ((string)$server['network'] === 'grpc') {
|
||||||
$grpcSettings = json_decode($server['networkSettings'], true);
|
$grpcSettings = json_decode($server['networkSettings'], true);
|
||||||
if (isset($grpcSettings['path'])) $config['path'] = $grpcSettings['serviceName'];
|
if (isset($grpcSettings['serviceName'])) $config['path'] = $grpcSettings['serviceName'];
|
||||||
}
|
}
|
||||||
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class V2rayNG
|
|||||||
}
|
}
|
||||||
if ((string)$server['network'] === 'grpc') {
|
if ((string)$server['network'] === 'grpc') {
|
||||||
$grpcSettings = json_decode($server['networkSettings'], true);
|
$grpcSettings = json_decode($server['networkSettings'], true);
|
||||||
if (isset($grpcSettings['path'])) $config['path'] = $grpcSettings['serviceName'];
|
if (isset($grpcSettings['serviceName'])) $config['path'] = $grpcSettings['serviceName'];
|
||||||
}
|
}
|
||||||
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user