From 0a6b1c671fdba13b8e83ce50f172493b2612d66f Mon Sep 17 00:00:00 2001 From: UUBulb <35923940+uubulb@users.noreply.github.com> Date: Fri, 7 Feb 2025 22:16:45 +0800 Subject: [PATCH] fix ws protocol (#117) --- src/components/fm.tsx | 1 + src/components/terminal.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/fm.tsx b/src/components/fm.tsx index 178a3da..c9dc2d1 100644 --- a/src/components/fm.tsx +++ b/src/components/fm.tsx @@ -162,6 +162,7 @@ const FMComponent: React.FC = ({ wsUrl, useEffect(() => { const url = new URL(wsUrl, window.location.origin) + url.protocol = url.protocol.replace("http", "ws") const ws = new WebSocket(url) wsRef.current = ws ws.binaryType = "arraybuffer" diff --git a/src/components/terminal.tsx b/src/components/terminal.tsx index 2014ddf..0342212 100644 --- a/src/components/terminal.tsx +++ b/src/components/terminal.tsx @@ -54,6 +54,7 @@ const XtermComponent = forwardRef