Documentation
¶
Index ¶
Constants ¶
const ( // DataChannelLabel is the pre-negotiated (id=0) DataChannel label WA Web uses. DataChannelLabel = "pre-negotiated" // SctpPort is the SCTP-over-DTLS WebRTC port (a WebRTC convention; pion's // sctp.Client negotiates over the DTLS conn and does not take it as config). SctpPort = 5000 )
Variables ¶
This section is empty.
Functions ¶
func UnwrapGroupForwardingPacket ¶
UnwrapGroupForwardingPacket removes a captured multi-participant relay forwarding header. Non-forwarded packets are returned unchanged.
Types ¶
type CallTransportError ¶
CallTransportError categorizes a relay-transport failure so a consumer can branch: Connect is fatal (the call can't reach the relay); Send/Recv are recoverable on an established channel.
func (*CallTransportError) Error ¶
func (e *CallTransportError) Error() string
func (*CallTransportError) Unwrap ¶
func (e *CallTransportError) Unwrap() error
type Option ¶
type Option func(*config)
Option configures optional, non-behavioral aspects of the relay channel — currently the diagnostic logger. The zero configuration logs nothing.
func WithLogger ¶
WithLogger sets the zerolog logger for debug/trace diagnostics. The library never configures logging itself; without this option the channel is silent at zero cost. Pass the logger from a context, e.g. WithLogger(*zerolog.Ctx(ctx)).
type RelayMediaChannel ¶
type RelayMediaChannel struct {
// contains filtered or unexported fields
}
RelayMediaChannel is an open relay media channel; STUN/RTP/RTCP travel as binary DataChannel messages. It owns the whole stack so Close tears it down cleanly (the reference relies on Rust Drop; Go needs explicit cleanup).
func ConnectRelayMedia ¶
func ConnectRelayMedia(relayAddr *net.UDPAddr, opts ...Option) (*RelayMediaChannel, error)
ConnectRelayMedia connects the full media stack (UDP→DTLS→SCTP→DataChannel) to one relay endpoint. Self-signed cert; server-cert verification skipped (media auth is HBH SRTP, not DTLS). No vector — validated only against a live relay.
func (*RelayMediaChannel) Close ¶
func (c *RelayMediaChannel) Close() error
Close tears down the media stack in reverse order of construction.
type RelayPacketKind ¶
type RelayPacketKind int
RelayPacketKind classifies a packet seen on the relay channel by its first byte.
const ( RelayPacketStun RelayPacketKind = iota RelayPacketRtcp RelayPacketRtp RelayPacketOther )
func ClassifyRelayPacket ¶
func ClassifyRelayPacket(data []byte, log ...zerolog.Logger) RelayPacketKind
ClassifyRelayPacket demuxes STUN from RTP/RTCP using the RTP version and payload type ranges. WhatsApp video RTCP sets a profile bit, so its first byte can be 0x91.