Their code does not respond to your issue. You want to share a websocket connection between two tabs, so that if you "socket.emit('lol')" from server both will receive this event, right?
As far as I understand their code, what they do here is syncing multiple connections (amongst multiple tabs) using local storage event. They do not *share* the connections, they *sync* them, giving the illusion it's shared.
You can achieve the exact same goal by simply emitting to rooms instead of single sockets, and putting all sockets of the same session in the same room.