diff --git a/src/components/layout/layout-traffic.tsx b/src/components/layout/layout-traffic.tsx index e920e7c..97caa82 100644 --- a/src/components/layout/layout-traffic.tsx +++ b/src/components/layout/layout-traffic.tsx @@ -32,7 +32,7 @@ const LayoutTraffic = () => { if (!clashInfo) return; const { server = "", secret = "" } = clashInfo; - connect(`ws://${server}/traffic?token=${secret}`); + connect(`ws://${server}/traffic?token=${encodeURIComponent(secret)}`); return () => { disconnect(); diff --git a/src/components/layout/use-log-setup.ts b/src/components/layout/use-log-setup.ts index 8dde19d..0c130ac 100644 --- a/src/components/layout/use-log-setup.ts +++ b/src/components/layout/use-log-setup.ts @@ -30,7 +30,7 @@ export const useLogSetup = () => { getClashLogs().then(setLogData); const { server = "", secret = "" } = clashInfo; - connect(`ws://${server}/logs?token=${secret}`); + connect(`ws://${server}/logs?token=${encodeURIComponent(secret)}`); return () => { disconnect();