# `mix xgw.spike`
[🔗](https://github.com/Lazarus404/xgw/blob/main/lib/mix/tasks/xgw.spike.ex#L1)

Lab Mix task: run a browser-facing DTLS-SRTP spike against a local XGW stack.

## What this is for

Manual proof that ICE, DTLS, and SRTP work end-to-end with Chrome. Not a
production entrypoint -- use it when debugging the media gateway path.

    mix xgw.spike --port 10000 --http-port 8080

Relay-only (colocated TURN on 127.0.0.1:3478):

    mix xgw.spike --port 10000 --http-port 8080 --relay-only

Defaults TURN URI `turn:127.0.0.1:3478` with username/password `xgw`/`xgwpass`
and realm `xirsys.com` (override via env `XGW_SPIKE_TURN_*` if needed).

Open http://127.0.0.1:8080/ in Chrome. Default page is transceiver-only (no
mic permission). Append `?mic=1` for live Opus SRTP proof. Hard-refresh after
each restart. Requires `XTURN_LOCAL_DEPS=1` and a local
[xmedialib](https://github.com/Lazarus404/xmedialib) checkout with the SRTP
HMAC fix.

ICE-TCP lab (TCP candidates only; forces TCP path without host firewall):

    mix xgw.spike --port 10000 --http-port 8080 --ice-tcp --ice-tcp-only

## RFCs

Exercises the same stack as `XGW`: RFC 8445 (ICE), RFC 5764 (DTLS-SRTP),
RFC 3711 (SRTP), optionally RFC 8656 (TURN relay-only) and RFC 6544 (ICE-TCP).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
