Explorar o código

fix: shadowrocket grpc

tokumeikoi %!s(int64=3) %!d(string=hai) anos
pai
achega
0284e47155
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      app/Utils/Shadowrocket.php

+ 5 - 4
app/Utils/Shadowrocket.php

@@ -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);