🔍 ASCII-Chat Discovery Service (acds) main entry point
The discovery service provides session management and WebRTC signaling for peer-to-peer ascii-chat connections. It uses the ACIP binary protocol over raw TCP to coordinate session creation, lookup, and WebRTC SDP/ICE relay.
Key Features
- Session Management: Create, lookup, join, and leave sessions
- Session Strings: Memorable session identifiers (e.g., "swift-river-mountain")
- WebRTC Signaling: SDP offer/answer and ICE candidate relay
- Identity Keys: Ed25519 keys for session authentication
- SQLite Persistence: Session registry and rate limiting
- Zero New Dependencies: Reuses all ascii-chat infrastructure
Protocol
Uses ACIP binary protocol (extends packet_type_t 0x20-0xFF):
- SESSION_CREATE/CREATED - Create new session
- SESSION_LOOKUP/INFO - Find existing session
- SESSION_JOIN/JOINED - Join session
- WEBRTC_SDP - Relay SDP offers/answers
- WEBRTC_ICE - Relay ICE candidates
Transport
Raw TCP on port 27225 (configurable via –port):
- Reuses lib/network/ packet handling
- Same crypto handshake as main ascii-chat
- Same accept/send/recv patterns
Command-Line Usage
acds [options] [address1] [address2]
Options:
--port PORT Listen port (default: 27225)
--database PATH SQLite database path (default: ~/.config/ascii-chat/acds.db)
--key PATH Ed25519 identity key path (default: ~/.config/ascii-chat/acds_identity)
--log-file FILE Log file path (default: stderr)
--log-level LEVEL Log level (dev, debug, info, warn, error, fatal)
--help Show this help
--version Show version
Positional Arguments (Bind Addresses):
address1 IPv4 or IPv6 bind address (0-2 addresses)
address2 Second bind address (must be different IP version)
- Author
- Zachary Fogg me@zf.nosp@m.o.gg
- Date
- December 2025
Definition in file acds/main.h.