mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-05 21:20:07 +00:00
fix ws protocol (#117)
This commit is contained in:
@@ -162,6 +162,7 @@ const FMComponent: React.FC<FMProps & JSX.IntrinsicElements["div"]> = ({ wsUrl,
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const url = new URL(wsUrl, window.location.origin)
|
const url = new URL(wsUrl, window.location.origin)
|
||||||
|
url.protocol = url.protocol.replace("http", "ws")
|
||||||
const ws = new WebSocket(url)
|
const ws = new WebSocket(url)
|
||||||
wsRef.current = ws
|
wsRef.current = ws
|
||||||
ws.binaryType = "arraybuffer"
|
ws.binaryType = "arraybuffer"
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ const XtermComponent = forwardRef<HTMLDivElement, XtermProps & JSX.IntrinsicElem
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
})
|
})
|
||||||
const url = new URL(wsUrl, window.location.origin)
|
const url = new URL(wsUrl, window.location.origin)
|
||||||
|
url.protocol = url.protocol.replace("http", "ws")
|
||||||
const ws = new WebSocket(url)
|
const ws = new WebSocket(url)
|
||||||
wsRef.current = ws
|
wsRef.current = ws
|
||||||
ws.binaryType = "arraybuffer"
|
ws.binaryType = "arraybuffer"
|
||||||
|
|||||||
Reference in New Issue
Block a user