Explorar o código

update: clash compatible

tokumeikoi %!s(int64=3) %!d(string=hai) anos
pai
achega
ec946918c9
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      app/Http/Controllers/Client/Protocols/Clash.php

+ 5 - 0
app/Http/Controllers/Client/Protocols/Clash.php

@@ -120,6 +120,11 @@ class Clash
                     $array['ws-opts']['path'] = $wsSettings['path'];
                 if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
                     $array['ws-opts']['headers'] = ['Host' => $wsSettings['headers']['Host']];
+                // TODO: 2022.06.01 remove it
+                if (isset($wsSettings['path']) && !empty($wsSettings['path']))
+                    $array['ws-path'] = $wsSettings['path'];
+                if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
+                    $array['ws-headers'] = ['Host' => $wsSettings['headers']['Host']];
             }
         }
         if ($server['network'] === 'grpc') {