A hassle-free, lobby-based PeerJS discovery server.
WebRTC (via PeerJS)
enables direct P2P connections, but only after peers exchange their Peer IDs. There is no built-in discovery protocol.
PeerBasket solves this signaling gap. You POST your Peer ID under a shared room name (a basket), and PeerBasket returns the Peer IDs of everyone else currently active in it.
Hosted Instance:
peerbasket.bittu.dev
Want to run your own? Self-host via GitHub
PeerBasket is a lightweight lookup table. It intentionally skips authentication to keep setups instant and friction-free. See the
Security
Considerations section below for more details.
Inactive peer heartbeats are automatically pruned after 30 seconds to clean up zombie rooms. It is free, open source, and backed by a fast in-memory Redis cache.
Two peers post to the same basket string, then instantly connect to any active peer IDs returned in the response.
Polling
Tip:
Call this fetch
every 10 seconds to stay alive in the pool and catch incoming peers.
Send your PeerJS peer ID in the request body. PeerBasket registers that peer ID under the basket_id given in the URL, which can be any string you choose, and returns the peer IDs of everyone else who is currently registered under that same basket_id.
{
"peer_id": "peerjs-abc-123"
}
{
"basket_id": "room-101",
"peers": ["peerjs-id-001", "peerjs-id-002"],
"total_peers": 2,
"peers_returned": 2
}
PeerBasket does no authentication, by design. A basket ID is the only thing that stands between a basket and the public. Treat a basket ID like an unlisted URL rather than a password, and pick something unguessable for anything that is not a throwaway demo, as recommended above.
This also means that PeerBasket cannot vouch for who is behind any peer ID it returns. Anyone who knows your basket ID can register their own peer into it, and your app will see that peer as just another member of the basket. If you are building anything beyond a quick prototype, verify identity at the application layer instead of trusting the raw peer list on its own. Two simple ways to do that are a shared secret exchanged out of band, or a handshake performed once the PeerJS connection actually opens.