fix(server): bind UDP media to the TCP port so self-host needs one forward rule
media_port defaulted to 0 (OS-assigned) and --port only set the TCP bind_port, so the UDP relay bound a random high port and advertised it to clients in HELLO. Self-hosters forwarding only 8384/udp saw connect-OK-but-no-voice, contradicting docs/deployment.md (control and media share one port). Media now follows bind_port when media_port is unset; 0=OS-assigned survives when bind_port is also 0 so ephemeral-port tests are unaffected. Banner now reads TCP :8384 UDP :8384. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ struct Config {
|
||||
std::string server_name = "VoiceCat Server";
|
||||
std::string data_dir = "voicecat-data";
|
||||
uint16_t bind_port = 8384; // 0 = let OS pick (useful for tests)
|
||||
uint16_t media_port = 0; // M2 UDP media port; 0 = OS-assigned
|
||||
uint16_t media_port = 0; // M2 UDP media; 0 = follow bind_port (or OS-pick if that's 0)
|
||||
bool allow_guests = true;
|
||||
// Called with the actual bound TCP port once the acceptor is ready.
|
||||
std::function<void(uint16_t)> on_ready;
|
||||
|
||||
Reference in New Issue
Block a user