mirror of
https://github.com/Xevion/dynamic-preauth.git
synced 2025-12-06 09:14:57 -06:00
use CORS websocket in dev mode
This commit is contained in:
@@ -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"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user