// const WS_BASE = 'ws://localhost:3000/ws/'; export function wsUrl(id: string) { if (import.meta.env.WS_BASE) { return import.meta.env.WS_BASE + id; } else { const loc = window.location; let newUri = loc.protocol === "https:" ? "wss://" : "ws://"; newUri += loc.host + '/ws/' + id; return newUri; } }