AirPlay.V2.Rtsp2 (AirPlay v0.2.0)

Copy Markdown View Source

Encrypted RTSP/1.0 over a paired AirPlay 2 connection. After AirPlay.V2.Pairing, the whole RTSP message (request line + headers + body) is wrapped through AirPlay.V2.SecureChannel (ChaCha20-Poly1305 block framing); responses are decrypted and parsed the same way. Mirrors RTSPClientV2.Request. Verified live against a real AirPlay 2 device (encrypted GET /info → decrypted 200 OK).

Summary

Functions

Send an encrypted RTSP request and read the decrypted response. Returns {:ok, status, headers_map, body, state} or {:error, reason}.

Wrap a paired socket + session key into an encrypted RTSP client.

Types

t()

@type t() :: %AirPlay.V2.Rtsp2{
  channel: term(),
  cseq: term(),
  inbuf: term(),
  sock: term()
}

Functions

request(state, method, path, headers \\ [], body \\ "")

@spec request(t(), String.t(), String.t(), [{String.t(), String.t()}], binary()) ::
  {:ok, non_neg_integer(), map(), binary(), t()} | {:error, term()}

Send an encrypted RTSP request and read the decrypted response. Returns {:ok, status, headers_map, body, state} or {:error, reason}.

wrap(sock, session_key)

@spec wrap(port(), binary()) :: t()

Wrap a paired socket + session key into an encrypted RTSP client.