hn.today

Peer-to-peer WebRTC connections with built-in signaling and discovery

github.com4 points1 comments
Screenshot of Peer-to-peer WebRTC connections with built-in signaling and discovery

like-webrtc is a JavaScript library for creating peer-to-peer WebRTC connections in browsers, Node.js, and React Native without building signaling and discovery from scratch. It provides a familiar server-and-client model: a server listens under a cryptographic public-key address, and another peer connects using that address. Applications can exchange data channels, audio or video tracks, and transceivers. The library supplies signaling, default STUN and TURN servers, and automatic exchange and negotiation of WebRTC connection details. Its signaling service uses a WebSocket RPC protocol and Noise encryption, while public keys serve as shareable peer identities rather than IP addresses.

For groups, peers can announce servers under shared topics, look up announced peers, or join a topic to discover and connect with others; joining also announces a listening peer. Connections can be restricted with a public-key firewall, and topic-based connections retry after disconnection on an increasing schedule. The API also supports stable identities generated from a seed, direct announcement management, and duplex-stream wrappers for data channels or WebSockets. Announcements can outlast an abrupt disconnect, so a lookup may return an offline peer. The package aims to make browser-based peer-to-peer applications practical, with a live demo modeled on a chat service. Its proposed extensions include encrypted relay messages, small-scale media forwarding, easier TURN deployment, and reusable tools for audio, video, and screen sharing.

Read on github.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Ggml v1.0.0

Ggml v1.0.0

ggml 1.0.0 removes deprecated public APIs and legacy DIAG_MASK operations, while adding configurable YaRN truncation and FP8 support. It also improves backend performance with quantized matrix multiplication, fused MoE operations, and new attention and scheduling paths. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.