use CORS websocket in dev mode

This commit is contained in:
2024-12-23 13:44:21 -06:00
parent 152635d7db
commit b7b010ba3e

View File

@@ -17,7 +17,9 @@ const StatefulDemo = ({ class: className }: StatefulDemoProps) => {
useEffect(() => { useEffect(() => {
const socket = new WebSocket( const socket = new WebSocket(
(window.location.protocol === "https:" ? "wss://" : "ws://") + (window.location.protocol === "https:" ? "wss://" : "ws://") +
window.location.host + (import.meta.env.DEV != undefined
? "localhost:5800"
: window.location.host) +
"/ws" "/ws"
); );