diff --git a/Cargo.lock b/Cargo.lock index 29f1114f8789..7b94d35b2529 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6549,6 +6549,7 @@ dependencies = [ "nohash-hasher", "once_cell", "parking_lot", + "percent-encoding", "rand", "re_build_info", "re_build_tools", diff --git a/crates/top/re_sdk/Cargo.toml b/crates/top/re_sdk/Cargo.toml index a40b1ce15c1d..adc64278d496 100644 --- a/crates/top/re_sdk/Cargo.toml +++ b/crates/top/re_sdk/Cargo.toml @@ -68,6 +68,7 @@ itertools.workspace = true nohash-hasher.workspace = true once_cell.workspace = true parking_lot.workspace = true +percent-encoding.workspace = true thiserror.workspace = true # Optional dependencies diff --git a/crates/top/re_sdk/src/recording_stream.rs b/crates/top/re_sdk/src/recording_stream.rs index 1b6fc3a1bfe3..f93e5aa25d62 100644 --- a/crates/top/re_sdk/src/recording_stream.rs +++ b/crates/top/re_sdk/src/recording_stream.rs @@ -1738,7 +1738,10 @@ impl RecordingStream { /// See [`Self::set_sink`] for more information. pub fn connect_grpc(&self) -> RecordingStreamResult<()> { self.connect_grpc_opts( - format!("http://127.0.0.1:{}", re_grpc_server::DEFAULT_SERVER_PORT), + format!( + "rerun+http://127.0.0.1:{}", + re_grpc_server::DEFAULT_SERVER_PORT + ), crate::default_flush_timeout(), ) } diff --git a/crates/top/re_sdk/src/web_viewer.rs b/crates/top/re_sdk/src/web_viewer.rs index b7b7ac67f924..fb2df732a20a 100644 --- a/crates/top/re_sdk/src/web_viewer.rs +++ b/crates/top/re_sdk/src/web_viewer.rs @@ -210,6 +210,12 @@ impl WebViewerConfig { }; if let Some(source_url) = source_url { + // TODO(jan): remove after we change to `rerun-http` + let source_url = source_url.to_string(); + let source_url = percent_encoding::utf8_percent_encode( + &source_url, + percent_encoding::NON_ALPHANUMERIC, + ); append_argument(format!("url={source_url}")); } if let Some(force_graphics) = force_wgpu_backend { diff --git a/rerun_py/src/python_bridge.rs b/rerun_py/src/python_bridge.rs index 07b84fa074d7..134cae50f7fa 100644 --- a/rerun_py/src/python_bridge.rs +++ b/rerun_py/src/python_bridge.rs @@ -598,13 +598,13 @@ fn connect_grpc( }; use re_sdk::external::re_grpc_server::DEFAULT_SERVER_PORT; + let url = url.unwrap_or_else(|| format!("rerun+http://127.0.0.1:{DEFAULT_SERVER_PORT}/proxy")); let re_uri::RedapUri::Proxy(endpoint) = url - .unwrap_or_else(|| format!("rerun+http://127.0.0.1:{DEFAULT_SERVER_PORT}")) .parse::() .map_err(|err| PyRuntimeError::new_err(err.to_string()))? else { return Err(PyRuntimeError::new_err(format!( - "invalid endpoint, expected {:?}", + "invalid endpoint {url:?}, expected {:?}", "/proxy" ))); };