Skip to content
Peerix v0.4 Released

Peerix v0.4 Released

May 28, 2026ยทmeefik
meefik

We are thrilled to announce the v0.4 release of the Peerix library. Peerix continues its mission of simplifying WebRTC development by abstracting the heavy lifting of signaling and connection management into a minimal, transport-agnostic API. This release focuses on expanding our signaling transport options for production environments, refining our API for a better developer experience, and optimizing performance under the hood.

Highlights: New Signaling Drivers for Production Scale

While our earlier releases focused on getting peers connected, v0.4 is about moving from local prototypes to distributed production environments. We’ve added two major signaling drivers to support industry-standard messaging infrastructure.

MQTT Driver

The MqttDriver enables signaling via the MQTT protocol and is specifically designed for MQTT over WebSockets. This allows developers to leverage robust brokers like Mosquitto for their signaling needs. It is an ideal choice for lightweight pub/sub signaling within existing messaging ecosystems.

Centrifuge Driver

The CentrifugeDriver integrates with the Centrifugo real-time messaging server. This driver is built for developers who need high fan-out capabilities and reliable reconnection support in high-traffic production environments.

SSE Driver Enhancements

The SseDriver has been updated to default to the Mercure-compatible endpoint (/.well-known/mercure), making it easier for developers using the Mercure hub to get started without additional configuration. This change simplifies setup and reduces friction for those leveraging Mercure for their signaling needs.

  • No external modules required.
  • Requires a running Mercure server or another SSE-compatible server (with a code example provided).
  • Documentation: SSE Driver

Improved Developer Experience: Local Testing with Docker

To lower the barrier for local development, v0.4 now includes example code snippets and configurations for running signaling backends locally using Docker. You can now quickly spin up instances of NATS, Mercure, Mosquitto, and Centrifugo with standardized setups. This ensures that your local testing environment mirrors your production infrastructure as closely as possible.

API Refinements

In our ongoing effort to create a more intuitive and consistent API, we have made some key changes to method naming conventions. The term publish has been reserved exclusively for the Signaling Layer to align with standard messaging terminology. For the Application Layer, we have introduced share and unshare to better describe how media and data streams are managed. This change helps avoid confusion between signaling events and application-level actions.

Migration Mapping

Old MethodNew MethodLayer
Driver.dispatchDriver.publishDriver
Peer.publishPeer.sharePeer (media streams)
Peer.unpublishPeer.unsharePeer (media streams)

Performance and Technical Optimizations

As a core maintainer, my focus is often on the “under-the-hood” efficiencies that keep your apps performant. This release includes several technical wins for reducing message overhead:

  • Protobuf-like Format: We have transitioned from a custom binary format to a Protobuf-like format for signaling messages. This transition allows us to use an industry-standard serialization method and reuse it across several internal components, reducing the need for custom parsing logic and minimizing message sizes.
  • ICE Candidate Debouncing: To minimize signaling chatter, we’ve introduced the iceCandidateDebounce option in the Peer class. It defaults to 50ms, batching candidates to reduce the frequency of messages sent during the negotiation phase.
  • SocketIoDriver Enhancements: We have added an ackTimeout option to the SocketIoDriver, giving you granular control over how long the client waits for server acknowledgments.
  • Simplified Event Naming: Most drivers now use peer or room identifiers directly as event names. By avoiding string concatenation, we’ve shortened name lengths to reduce signaling overhead.

Upgrade and Migration Notes

If you are moving from v0.3 to v0.4, please review these breaking changes:

  • Method Renaming: All application-level calls to publish and unpublish must be updated to share and unshare. This change applies to both the Peer and RemotePeer classes.
  • Driver Active State: The Driver class now initializes with the active accessor set to false by default. Ensure your logic accounts for the driver state during startup.
  • Prefix Handling & Separators: Some drivers now use empty prefixes by default and no longer automatically include separators. If you require a separator, it must be part of your prefix string.
    • Example: If your prefix is peerix and the event is event, it will result in peerixevent. To get peerix:event, you must define the prefix as peerix:.
  • Namespace Hashing Compatibility: When namespaceHashing is disabled, the room property is now automatically escaped. This prevents character compatibility issues with certain signaling backends that do not support specific symbols or spaces.

Conclusion

This release brings us closer to a truly plug-and-play WebRTC experience that scales. For full details on these changes, please visit our updated resources: