Omiai is the Phoenix signaling relay used by XiaDianxin/Sankaku peers.
- Authenticated websocket signaling socket at
/ws/sankaku(OmiaiWeb.SankakuSocket) - Peer channel topics:
peer:<public_key>(OmiaiWeb.SignalingChannel) - Dual event contract routing (canonical SDP events + legacy aliases)
- Presence tracking for online peer fast-fail behavior
- Quicdial runtime registry:
public_key => peer_ipwhile peer is connected resolve_quicdialchannel event for resolving a target Quicdial code to current IP- mDNS advertisement for zero-config LAN discovery (
_omiai._tcp)
- Peer connects websocket with
public_key. - Socket extracts
peer_dataIP from endpointconnect_info. OmiaiWeb.QuicdialRegistrystores%{public_key => ip}for that socket process.- Caller pushes:
{
"event": "resolve_quicdial",
"payload": { "code": "target_public_key" }
}- Channel replies:
- Success:
%{ip: "203.0.113.10"} - Failure:
%{"reason" => "offline"}
- Success:
IPv4 and IPv6 peer tuples are both supported when extracting peer_data.address.
After websocket upgrade, clients should push this payload to register_startup:
{
"public_key": "alice_public_key",
"session_token": "session-token",
"sig_ts": "1741205660123",
"sig_nonce": "f1ec6d6a-18c7-43d4-b5b4-c73c97f4a70e"
}Omiai refreshes Presence metadata and Quicdial IP mapping on that call.
Omiai advertises itself on LAN as:
- Service type:
_omiai._tcp - Instance:
Omiai_Local_Node - Port: endpoint HTTP port (default
4000) - TXT payload includes websocket path:
/ws/sankaku/websocket
mix setup
mix phx.serverDev endpoint binds on 0.0.0.0:4000 for LAN/iOS device testing.
Websocket endpoint is ws://<LAN-IP>:4000/ws/sankaku/websocket.
mix testChannel tests cover:
- Canonical/legacy event routing
- Presence lifecycle
- Quicdial resolve success/offline behavior