function create(path: string): Promise<WebSocket> {
  const ws = new WebSocket((import.meta.env.ENV_WEBSOCKET_BASE ?? '') + path);
  return new Promise((resolve, reject) => {
    ws.onopen = () => resolve(ws);
    ws.onerror = (e) => reject(e);
  });
}
export default { create };
