fix: clarify OrcaCloud signaling endpoint contract

This commit is contained in:
Ian Chua
2026-09-24 18:18:48 +08:00
parent fa98ec5afe
commit 5a0810365b
3 changed files with 6 additions and 13 deletions
@@ -163,6 +163,8 @@ public:
// Configuration
void configure_urls(AppConfig* app_config);
// Hostname only; cloud REST, MQTT, and WebRTC signaling use fixed TLS
// endpoints on port 443.
void set_api_base_url(const std::string& url);
void set_auth_base_url(const std::string& url);
void set_cloud_base_url(const std::string& url);
+4 -12
View File
@@ -91,17 +91,6 @@ std::string OrcaCloudSignalingChannel::encode_path_component(const std::string&
return encoded.str();
}
std::string OrcaCloudSignalingChannel::host_without_scheme(std::string value)
{
const auto scheme = value.find("://");
if (scheme != std::string::npos)
value.erase(0, scheme + 3);
const auto slash = value.find('/');
if (slash != std::string::npos)
value.erase(slash);
return value;
}
void OrcaCloudSignalingChannel::unavailable(CameraUnavailableReason reason, std::string detail)
{
if (on_unavailable)
@@ -117,7 +106,10 @@ void OrcaCloudSignalingChannel::run()
return;
}
const std::string token = m_cloud->get_access_token();
const std::string host = host_without_scheme(m_cloud->get_cloud_service_host());
// OrcaCloud exposes a bare API hostname. WebRTC signaling uses the
// fixed HTTPS/WSS endpoints on port 443; custom schemes, ports, and
// base paths are not supported by this agent.
const std::string host = m_cloud->get_cloud_service_host();
if (token.empty() || host.empty()) {
unavailable(CameraUnavailableReason::Error, "OrcaCloud session is unavailable");
m_open.store(false);
@@ -50,7 +50,6 @@ private:
void send_json(const std::string& message);
void unavailable(CameraUnavailableReason reason, std::string detail);
static std::string encode_path_component(const std::string& value);
static std::string host_without_scheme(std::string value);
OrcaCloudServiceAgent* m_cloud;
std::string m_dev_id;