From 53b3aa72a0490df6bafe4c727fc8b6944bb69a5d Mon Sep 17 00:00:00 2001 From: Arjun Dhaliwal Date: Wed, 10 Jun 2026 15:04:47 -0700 Subject: [PATCH] Clarify the proxy port + show the non-proxy port to the user. --- .../cuttlefish/host/commands/assemble_cvd/flags.cc | 10 +++++++--- .../host/commands/run_cvd/launch/streamer.cpp | 2 +- .../host/libs/config/cuttlefish_config.cpp | 12 ++++++++++-- .../cuttlefish/host/libs/config/cuttlefish_config.h | 4 ++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc b/base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc index f5d4e357d5e..5e7bcad5f9d 100644 --- a/base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc +++ b/base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc @@ -1244,9 +1244,13 @@ Result InitializeCuttlefishConfiguration( "Error in looking up num to webrtc_device_id_flag_map"); instance.set_webrtc_device_id(num_to_webrtc_device_id_flag_map[num]); - auto port = 8443 + num - 1; - // Change the signaling server port for all instances - tmp_config_obj.set_sig_server_proxy_port(port); + // TODO(b/522400327): It would be nice to consolidate the port definitions around here. + auto sig_server_port = 1443; + tmp_config_obj.set_sig_server_port(sig_server_port); + + auto sig_server_proxy_port = 8443 + num - 1; + // Change the signaling server proxy port for all instances + tmp_config_obj.set_sig_server_proxy_port(sig_server_proxy_port); instance.set_start_netsim(is_first_instance && is_any_netsim); instance.set_start_rootcanal(is_first_instance && any_not_netsim_bt && diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/launch/streamer.cpp b/base/cvd/cuttlefish/host/commands/run_cvd/launch/streamer.cpp index 5c22c264dd4..c29a6b2c795 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/launch/streamer.cpp +++ b/base/cvd/cuttlefish/host/commands/run_cvd/launch/streamer.cpp @@ -221,7 +221,7 @@ class WebRtcServer : public virtual CommandSource, } std::ostringstream out; out << "Point your browser to https://localhost:" - << config_.sig_server_proxy_port() << " to interact with the device."; + << config_.sig_server_port() << " to interact with the device."; return {out.str()}; } diff --git a/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.cpp b/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.cpp index 3e545b1cb96..c1f54dbcda4 100644 --- a/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.cpp +++ b/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.cpp @@ -137,13 +137,21 @@ void CuttlefishConfig::set_gem5_debug_flags(const std::string& gem5_debug_flags) } static constexpr char kSigServerPort[] = "webrtc_sig_server_port"; -void CuttlefishConfig::set_sig_server_proxy_port(int port) { +void CuttlefishConfig::set_sig_server_port(int port) { (*dictionary_)[kSigServerPort] = port; } -int CuttlefishConfig::sig_server_proxy_port() const { +int CuttlefishConfig::sig_server_port() const { return (*dictionary_)[kSigServerPort].asInt(); } +static constexpr char kSigServerProxyPort[] = "webrtc_sig_server_proxy_port"; +void CuttlefishConfig::set_sig_server_proxy_port(int port) { + (*dictionary_)[kSigServerProxyPort] = port; +} +int CuttlefishConfig::sig_server_proxy_port() const { + return (*dictionary_)[kSigServerProxyPort].asInt(); +} + static constexpr char kSigServerAddress[] = "webrtc_sig_server_addr"; void CuttlefishConfig::set_sig_server_address(const std::string& addr) { (*dictionary_)[kSigServerAddress] = addr; diff --git a/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.h b/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.h index 5ab5d7f8738..838d20eacdd 100644 --- a/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.h +++ b/base/cvd/cuttlefish/host/libs/config/cuttlefish_config.h @@ -191,6 +191,10 @@ class CuttlefishConfig { void set_extra_kernel_cmdline(const std::string& extra_cmdline); std::vector extra_kernel_cmdline() const; + // The port for the signaling (operator) server. + void set_sig_server_port(int port); + int sig_server_port() const; + // The port for the webrtc signaling server proxy. void set_sig_server_proxy_port(int port); int sig_server_proxy_port() const;