Files
modules/routing-advanced/hyper-p2p-sticky-session
2026-05-20 22:56:32 -04:00
..
2026-05-20 22:56:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 21:19:52 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 22:56:32 -04:00

hyper-p2p-sticky-session

Session to peer bindings with gossip sync.

Protocol: sticky-session/v1

When to use

  • User/session affinity to a specific worker or storage peer.
  • Replicated binding tables on a Hyperswarm topic.

When not to use

  • Stateless round-robin (use load-spread).
  • Global leader election.

Quick start

const { HyperP2PStickySession } = require('hyper-p2p-sticky-session')
const ss = new HyperP2PStickySession({ topic: 'sessions' })
await ss.ready()
ss.bind('user-42', 'peer-7')
console.log(ss.resolve('user-42'))
await ss.close()

Docs

Test

npm install && npm test