update: code

This commit is contained in:
tokumeikoi 2021-07-02 22:07:54 +09:00
parent 0284e47155
commit e01e951f7f
2 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ class Clash
if ($server['tls']) {
$array['tls'] = true;
if (isset($server['tlsSettings'])) {
if ($server['tlsSettings']) {
$tlsSettings = json_decode($server['tlsSettings'], true);
if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure']))
$array['skip-cert-verify'] = ($tlsSettings['allowInsecure'] ? true : false);
@ -42,7 +42,7 @@ class Clash
}
if ($server['network'] === 'ws') {
$array['network'] = 'ws';
if (isset($server['networkSettings'])) {
if ($server['networkSettings']) {
$wsSettings = json_decode($server['networkSettings'], true);
if (isset($wsSettings['path']) && !empty($wsSettings['path']))
$array['ws-path'] = $wsSettings['path'];
@ -52,7 +52,7 @@ class Clash
}
if ($server['network'] === 'grpc') {
$array['network'] = 'grpc';
if (isset($server['networkSettings'])) {
if ($server['networkSettings']) {
$grpcObject = json_decode($server['networkSettings'], true);
$array['grpc-opts'] = [];
$array['grpc-opts']['grpc-service-name'] = $grpcObject['serviceName'];

View File

@ -46,7 +46,7 @@ class Shadowrocket
}
if ($server['network'] === 'grpc') {
$config['obfs'] = "grpc";
if (isset($server['networkSettings'])) {
if ($server['networkSettings']) {
$grpcSettings = json_decode($server['networkSettings'], true);
if (isset($grpcSettings['serviceName']) && !empty($grpcSettings['serviceName']))
$config['path'] = $grpcSettings['serviceName'];