Socket
Book a DemoInstallSign in
Socket

@livestore/webmesh

Package Overview
Dependencies
Maintainers
2
Versions
503
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livestore/webmesh

Webmesh is a library for connecting multiple nodes (windows/tabs, workers, threads, ...) in a network-like topology. It helps to establish communication channels between nodes.

0.3.1
latest
npmnpm
Version published
Weekly downloads
4K
-2.47%
Maintainers
2
Weekly downloads
 
Created
Source

@livestore/webmesh

Webmesh is a library for connecting multiple nodes (windows/tabs, workers, threads, ...) in a network-like topology. It helps to establish communication channels between nodes.

There are three types of channels:

  • ProxyChannel: a virtual channel by proxying messages along edges (via hop nodes)
  • DirectChannel: an end-to-end channel with support for transferable objects (e.g. Uint8Array)
  • BroadcastChannel: a virtual channel by broadcasting messages to all connected nodes

ProxyChannels and DirectChannels have the following properties (similar to TCP):

  • Has a unique name across the network
  • Auto-reconnects
  • Ordered messages
  • Reliable (buffers messages and acks each message)

Available edge connection implementations

  • MessageChannel
  • BroadcastChannel (both web and Node.js)
  • WebSocket
  • window.postMessage

Important notes

  • Each node name needs to be unique in the network.
    • The node name is also used as a "tie-breaker" as part of the messaging protocol.
  • It's using the WebChannel concept from the @livestore/utils package.
  • We assume network edges to be low-latency (a few ms)
  • Webmesh is used in LiveStore as the foundation for the LiveStore devtools protocol communication.
  • The implementation should avoid timeout-based "solutions" as much as possible.

Tradeoffs

  • Webmesh isn't meant for larger networks
  • Nodes are mostly stateless to simplify the protocol / implementation

Inspiration

  • Elixir Distribution / OTP
    • https://elixirschool.com/en/lessons/advanced/otp_distribution
  • Consul by HashiCorp
  • Ethernet

FAQs

Package last updated on 06 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.