Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1244,9 +1244,13 @@ Result<CuttlefishConfig> 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 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()};
}

Expand Down
12 changes: 10 additions & 2 deletions base/cvd/cuttlefish/host/libs/config/cuttlefish_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions base/cvd/cuttlefish/host/libs/config/cuttlefish_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ class CuttlefishConfig {
void set_extra_kernel_cmdline(const std::string& extra_cmdline);
std::vector<std::string> extra_kernel_cmdline() const;

// The port for the signaling (operator) server.
void set_sig_server_port(int port);
int sig_server_port() const;

Comment on lines +194 to +197

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a constant, it doesn't need to be in the config.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, I'll remove this config declaration. if I want to avoid hardcoding "1443" in the string in streamer.cpp, where should i declare the constant? i don't believe i saw this constant defined anywhere

// The port for the webrtc signaling server proxy.
void set_sig_server_proxy_port(int port);
int sig_server_proxy_port() const;
Expand Down
Loading