From 0d66dc76a1e7d28fe493a4f50864b287a3241ab5 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sat, 8 Nov 2025 17:17:32 -0500 Subject: [PATCH] feat: add environment variable support for UDP port configuration in domain connection --- src/OverteClient.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/OverteClient.cpp b/src/OverteClient.cpp index f257325..4f9d1a3 100644 --- a/src/OverteClient.cpp +++ b/src/OverteClient.cpp @@ -44,6 +44,13 @@ bool OverteClient::connect() { auto colon = url.find(':'); m_host = colon == std::string::npos ? url : url.substr(0, colon); m_port = colon == std::string::npos ? 40102 : std::stoi(url.substr(colon + 1)); + + // Check for environment override for UDP port (domain server UDP port) + const char* portEnv = std::getenv("OVERTE_UDP_PORT"); + int udpPort = portEnv ? std::atoi(portEnv) : 40104; // Default to 40104 for Overte domain UDP + + std::cout << "[OverteClient] Connecting to domain at " << m_host + << " (HTTP:" << m_port << ", UDP:" << udpPort << ")" << std::endl; // Resolve host:port addrinfo hints{}; hints.ai_socktype = SOCK_STREAM; hints.ai_family = AF_UNSPEC;