XGW.Spike.Server (xgw v0.1.0)

Copy Markdown View Source

Browser spike GenServer: one Listener + Peer, SDP answer, trickle ICE, status.

Started by mix xgw.spike; HTTP routes call answer/2 and candidate helpers.

Summary

Functions

Trickles a remote ICE candidate into the Peer (candidate / sdpMid map).

Builds and applies a local answer for offer, returning the SDP answer string.

Returns a specification to start this module under a supervisor.

Local candidate lines gathered since index since (trickle poll).

Starts the named spike server. Opts are forwarded to XGW.Listener.start_link/1 plus :ice_tcp_only for TCP-only answer candidates.

Returns a map of spike counters (ICE/DTLS/RTP/SCTP, transport, candidates).

Functions

add_remote_candidate(params)

@spec add_remote_candidate(map()) :: :ok | {:error, term()}

Trickles a remote ICE candidate into the Peer (candidate / sdpMid map).

answer(offer, opts \\ [])

@spec answer(
  binary(),
  keyword()
) :: binary() | {:error, term()}

Builds and applies a local answer for offer, returning the SDP answer string.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

local_candidates_since(since)

@spec local_candidates_since(non_neg_integer()) :: {[String.t()], non_neg_integer()}

Local candidate lines gathered since index since (trickle poll).

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the named spike server. Opts are forwarded to XGW.Listener.start_link/1 plus :ice_tcp_only for TCP-only answer candidates.

status()

@spec status() :: map()

Returns a map of spike counters (ICE/DTLS/RTP/SCTP, transport, candidates).