Add trunk TCP server for bidirectional peer connections

Previously TrunkLink only connected outbound — there was no server
listening on port 5302, so both reflectors got "Connection refused."

Changes:
- Reflector: add trunk TcpServer (default port 5302, configurable
  via TRUNK_LISTEN_PORT) that accepts inbound peer connections,
  authenticates via HMAC, and matches by secret + prefix
- TrunkLink: support both outbound and inbound directions with
  automatic conflict resolution (lower priority keeps outbound)
- Security: pre-auth frame size cap (4KB), max 5 pending connections,
  10s hello timeout, log-injection sanitization
- Docs: updated TRUNK_PROTOCOL.md, README.md, CLAUDE.md
This commit is contained in:
Audric committed 2026-03-26 12:59:04 +01:00
1 parent 53a9a6fc75
commit b8d0dd19af
7 files changed
+563 -38

No files matched your search

@@ -93,6 +93,7 @@ CERT_CA_HOOK=@SVX_SHARE_INSTALL_DIR@/ca-hook.py
# Reflector B: LOCAL_PREFIX=2, [TRUNK_1] with REMOTE_PREFIX=1
#
#LOCAL_PREFIX=1
#TRUNK_LISTEN_PORT=5302
#[TRUNK_2]
#HOST=reflector-b.example.com