---
title: "Comment by netproxy on \"Getting Zalo Web to Run in Every Tab with One Socket\" | Hashnode"
description: "The two-locks framing makes the whole thing easy to follow, and using the Web Locks API for leader election is a neat fit for this problem. The hub/follower spl"
url: "https://hashnode.com/posts/getting-zalo-web-to-run-in-every-tab-with-one-socket/6aef5aea4085efce9fc2d4ec/comment/6aefb499067a514fd7918e4b"
---

[Discussion](https://hashnode.com/posts/getting-zalo-web-to-run-in-every-tab-with-one-socket/6aef5aea4085efce9fc2d4ec)

Comment [Getting Zalo Web to Run in Every Tab with One Socket](https://hashnode.com/posts/getting-zalo-web-to-run-in-every-tab-with-one-socket/6aef5aea4085efce9fc2d4ec)

[netproxy](https://hashnode.com/@argumentmoney8117)

[Nov 7](https://hashnode.com/posts/getting-zalo-web-to-run-in-every-tab-with-one-socket/6aef5aea4085efce9fc2d4ec/comment/6aefb499067a514fd7918e4b)

The two-locks framing makes the whole thing easy to follow, and using the Web Locks API for leader election is a neat fit for this problem. The hub/follower split with a virtual WebSocket relay is an elegant way to keep every tab believing it has its own connection. The honest 'what it does not fix' section is appreciated too.

[Nhật Trường](https://hashnode.com/@nh4ttruong)

[Nov 9](https://hashnode.com/posts/getting-zalo-web-to-run-in-every-tab-with-one-socket/6aef5aea4085efce9fc2d4ec/comment/6aefb499067a514fd7918e4b#reply-6af195b47f00aa502ff185aa)

Thanks for reading! The browser does the leader election, so when the hub tab closes, another tab takes over with no extra code.
