浏览代码

update: clash compatible

tokumeikoi 3 年之前
父节点
当前提交
ec946918c9
共有 1 个文件被更改,包括 5 次插入0 次删除
  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') {