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:
1 parent
53a9a6fc75
commit
b8d0dd19af
7 files changed
+563
-38
No files matched your search
@@ -103,8 +103,9 @@ when a single reflector owns multiple prefix groups:
|
||||
```ini
|
||||
[GLOBAL]
|
||||
LISTEN_PORT=5300
|
||||
LOCAL_PREFIX=1 # owns TGs 1, 10, 100, 1000, ...
|
||||
# LOCAL_PREFIX=11,12,13 # multiple prefixes on one instance
|
||||
LOCAL_PREFIX=1 # owns TGs 1, 10, 100, 1000, ...
|
||||
# LOCAL_PREFIX=11,12,13 # multiple prefixes on one instance
|
||||
# TRUNK_LISTEN_PORT=5302 # trunk server port (default 5302)
|
||||
```
|
||||
|
||||
### 2. Cluster TGs (optional)
|
||||
@@ -145,9 +146,13 @@ Repeat for each peer (`[TRUNK_3]`, `[TRUNK_4]`, …).
|
||||
|
||||
### Network requirements
|
||||
|
||||
**Trunk links** require **mutual reachability**: each reflector connects outbound
|
||||
to every peer, so all reflectors in the mesh need a static IP (or stable DNS
|
||||
name) and the trunk port (default 5302) open for inbound TCP connections.
|
||||
**Trunk links** require **mutual reachability**: each reflector both listens for
|
||||
inbound trunk connections and connects outbound to every peer. Both sides
|
||||
attempt to connect simultaneously; the first connection that authenticates
|
||||
becomes the active link (duplicate connections are resolved automatically via
|
||||
priority-based tie-breaking). All reflectors in the mesh need a static IP (or
|
||||
stable DNS name) and the trunk port (default 5302, configurable via
|
||||
`TRUNK_LISTEN_PORT`) open for inbound TCP connections.
|
||||
|
||||
**Satellite links** are **one-way**: the satellite connects outbound to the
|
||||
parent. Only the parent needs a static IP and its satellite port (default 5303)
|
||||
|
||||
Reference in new issue
Block a user