mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
Fix Clash Json decode error
This commit is contained in:
parent
cb8e34fa2e
commit
98ac5cb680
@ -112,7 +112,7 @@ class Clash
|
|||||||
if ($server['tls']) {
|
if ($server['tls']) {
|
||||||
$array['tls'] = true;
|
$array['tls'] = true;
|
||||||
if ($server['tlsSettings']) {
|
if ($server['tlsSettings']) {
|
||||||
$tlsSettings = json_decode($server['tlsSettings'], true);
|
$tlsSettings = $server['tlsSettings'];
|
||||||
if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure']))
|
if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure']))
|
||||||
$array['skip-cert-verify'] = ($tlsSettings['allowInsecure'] ? true : false);
|
$array['skip-cert-verify'] = ($tlsSettings['allowInsecure'] ? true : false);
|
||||||
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
|
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
|
||||||
@ -122,7 +122,7 @@ class Clash
|
|||||||
if ($server['network'] === 'ws') {
|
if ($server['network'] === 'ws') {
|
||||||
$array['network'] = 'ws';
|
$array['network'] = 'ws';
|
||||||
if ($server['networkSettings']) {
|
if ($server['networkSettings']) {
|
||||||
$wsSettings = json_decode($server['networkSettings'], true);
|
$wsSettings = $server['networkSettings'];
|
||||||
if (isset($wsSettings['path']) && !empty($wsSettings['path']))
|
if (isset($wsSettings['path']) && !empty($wsSettings['path']))
|
||||||
$array['ws-path'] = $wsSettings['path'];
|
$array['ws-path'] = $wsSettings['path'];
|
||||||
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
|
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
|
||||||
@ -132,7 +132,7 @@ class Clash
|
|||||||
if ($server['network'] === 'grpc') {
|
if ($server['network'] === 'grpc') {
|
||||||
$array['network'] = 'grpc';
|
$array['network'] = 'grpc';
|
||||||
if ($server['networkSettings']) {
|
if ($server['networkSettings']) {
|
||||||
$grpcObject = json_decode($server['networkSettings'], true);
|
$grpcObject = $server['networkSettings'];
|
||||||
$array['grpc-opts'] = [];
|
$array['grpc-opts'] = [];
|
||||||
$array['grpc-opts']['grpc-service-name'] = $grpcObject['serviceName'];
|
$array['grpc-opts']['grpc-service-name'] = $grpcObject['serviceName'];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user