← go back
jeffalo has a redirect button which can send all online users to a new url. he’s used it several times.
Here’s the client side code:
o.on("redirect", (function(t) {
window.location.href = t
})),
(pretty simple)
How it works: when online, all browser tabs connect to a socket.io server. this is how you get real-time stuff like live messages count. It sends a message telling everyone’s browser to redirect. This is the most genius use of socket.io I’ve ever heard
Apr 17, 2022, 10:47 PM
(edited)
3 1 4
Comments