Documentation
¶
Index ¶
- Constants
- func AppendQuery(rawURL, key, value string) (string, error)
- func AppendRoomQuery(signalBase, room string) (string, error)
- func AppendRoomToICEURL(signalBase, room string) (string, error)
- func DeriveSignalBaseFromHostPort(hostport string) (string, error)
- func EncodeFrame(f Frame) ([]byte, error)
- func ICERelayURL(signalBase string) (string, error)
- func JoinURL(relayBase, room string) (string, error)
- func MustJoinURL(relayBase, room string) string
- func RoomID(aidA, aidB string) string
- func SubscribeURL(signalBase string) (string, error)
- type Frame
- type Hub
- type Relay
Constants ¶
const SubprotocolICE = "a2al.ice.v1"
SubprotocolICE is negotiated on the WebSocket used for ICE trickle signaling.
Variables ¶
This section is empty.
Functions ¶
func AppendQuery ¶ added in v0.1.4
AppendQuery sets or replaces a single query key on rawURL.
func AppendRoomQuery ¶
AppendRoomQuery adds or replaces the "room" query parameter on signalBase (absolute ws/wss URL).
func AppendRoomToICEURL ¶ added in v0.1.4
AppendRoomToICEURL is ICERelayURL + AppendRoomQuery.
func DeriveSignalBaseFromHostPort ¶ added in v0.1.4
DeriveSignalBaseFromHostPort builds ws:// or wss:// base (no path) from host:port.
func ICERelayURL ¶ added in v0.1.4
ICERelayURL returns signalBase with path set to /ice.
func MustJoinURL ¶
MustJoinURL is JoinURL that panics on error (for tests with fixed inputs).
func SubscribeURL ¶ added in v0.1.4
SubscribeURL returns WebSocket URL for callee persistent registration (/signal).
Types ¶
type Frame ¶
type Frame struct {
T string `cbor:"t"`
U string `cbor:"u,omitempty"` // ufrag (cred)
P string `cbor:"p,omitempty"` // pwd (cred)
C string `cbor:"c,omitempty"` // ice candidate Marshal string
AID string `cbor:"a,omitempty"` // reg: callee AID; reserved for future use
Sig string `cbor:"s,omitempty"` // reg: reserved (AID squatting prevention)
Room string `cbor:"r,omitempty"` // incoming: room id
Caller string `cbor:"f,omitempty"` // incoming: caller AID string
Target string `cbor:"g,omitempty"` // incoming: callee AID (hub lookup key)
}
Frame is a CBOR envelope on the signaling WebSocket. T is "cred" | "cand" | "eoc" | "reg" | "incoming" | "noagent".
type Hub ¶ added in v0.1.4
type Hub struct {
// contains filtered or unexported fields
}
Hub is an A2AL ICE signaling server: callee subscription on /signal and trickle relay on /ice (with optional target= for waking callees).
func ListenHub ¶ added in v0.1.4
ListenHub serves /signal and /ice on tcpAddr (e.g. "0.0.0.0:4121").
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
Relay is a minimal WebSocket relay: two clients joining the same ?room= are paired and their binary frames are forwarded bidirectionally. Intended for tests and small-scale deployments.
func StartRelay ¶
StartRelay listens on addr (e.g. "127.0.0.1:0") and serves the relay.