@hyperfrontend/network-protocol/browser/sendersender
Browser-side outbound packet sender with serialization and encryption pre-wired.
createSender builds a Sender from a SendFn transport callback (typically target.postMessage, a WebSocket.send, or a Worker.postMessage) and the protocol-specific encryption pipeline. The returned sender exposes the OutboundQueue / OutboundQueues interface so callers can enqueue messages without thinking about packet construction; serialization, encryption, and obfuscation happen inside the queue before the wire callback fires. Pair with /browser/receiver on the other end and a protocol from /browser/v1 or /browser/v2.
API Reference
◈ Interfaces
Represents an outbound processing queue with measurable size
Properties
Collection of outbound processing queues
Sender interface for processing outbound packets
Properties
◆ Types
Factory function type for creating a Sender instance
type CreateSender = (label: string, sender: SendPacketFn, logger: Logger, packetEncryption: PacketEncryption<T>, packetObfuscation: PacketObfuscation) => Sender<T>Function to send data from an origin to a target
type SendFn = (origin: string, target: string, data: Data<T>) => voidCallback invoked to transmit raw packet bytes
type SendPacketFn = (packet: Uint8Array) => void