Parlora.Channels.Browser.Signaling (Parlora v0.1.0)

Copy Markdown View Source

Mountable WebSock signaling for one application-owned session.

The host authenticates and checks the Origin before calling upgrade/2. Supply start_session: fn channel -> MyApp.start_session(channel) end. That function runs in the socket process and must use event_sink: self(). Optional on_ready: fn session -> ... end supplies an application greeting. channel_options carries ICE and media settings. No listener starts here.

The browser sends an offer, candidates, status, disconnect, or control with action equal to stop, clear, or resume. Microphone mute is local to the browser track. Text frames are limited to 64 KiB, signaling to 128 messages, controls to 512 per socket, and inactivity to 30 seconds. The client sends a ping every five seconds while connected. No session is restored.

Wait for attached before sending the offer, send local candidates after the offer, and queue server candidates until its answer is applied. Session ready follows negotiation. See the JSON protocol and minimal client.

Summary

Functions

Upgrade an already authorized host route to a session WebSocket.

Functions

upgrade(conn, options)

Upgrade an already authorized host route to a session WebSocket.