Create a new instance of the driver.
Configuration options for the driver.
A function that returns a promise resolving to a NATS connection instance.
Optionalprefix?: stringAn optional prefix for NATS subjects.
Optionalsecret?: stringAn optional secret key for encrypting messages.
Closes the connection to the NATS server.
Publish a signaling message to a namespace.
Target namespace segments.
Unsubscribe a previously registered namespace handler.
Namespace segments used for message routing.
Handler reference originally passed to on.
Subscribe to signaling messages in a namespace.
Namespace segments used for message routing.
Callback invoked with message payload.
Opens the connection to the NATS server and initializes encryption if a secret is provided.
Optionalconfig: anyOptional configuration options.
NATS-based signaling driver for inter-process communication.
This driver uses NATS as the underlying messaging system, allowing for distributed signaling across multiple browsers and devices. It supports optional encryption of messages using AES-GCM with a secret key and namespace hashing using SHA-256 for obfuscation.
Example