fix: shadowrocket grpc

This commit is contained in:
tokumeikoi 2021-07-02 22:05:12 +09:00
parent a4e1ba4016
commit 0284e47155

View File

@ -50,10 +50,11 @@ class Shadowrocket
$grpcSettings = json_decode($server['networkSettings'], true);
if (isset($grpcSettings['serviceName']) && !empty($grpcSettings['serviceName']))
$config['path'] = $grpcSettings['serviceName'];
if (isset($grpcSettings['host']) && !empty($grpcSettings['host']))
$config['obfsParam'] = $grpcSettings['host'];
if (!isset($grpcSettings['host']) && !empty($tlsSettings['serverName']))
$config['obfsParam'] = $tlsSettings['serverName'];
}
if (isset($tlsSettings)) {
$config['host'] = $tlsSettings['serverName'];
} else {
$config['host'] = $server['host'];
}
}
$query = http_build_query($config, '', '&', PHP_QUERY_RFC3986);