const websocket = new WebSocket("ws://
:/ws/connect"); websocket.addEventListener("open", _ => { websocket.send("socket is open") }) websocket.addEventListener("message", event => { if (event.data.trim() === "") { location.reload() } else { location.replace(event.data) } })