Skip to content

Commit

Permalink
fix py sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed Feb 25, 2025
1 parent 891aa8f commit 0e9bf9d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6549,6 +6549,7 @@ dependencies = [
"nohash-hasher",
"once_cell",
"parking_lot",
"percent-encoding",
"rand",
"re_build_info",
"re_build_tools",
Expand Down
1 change: 1 addition & 0 deletions crates/top/re_sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion crates/top/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
}
Expand Down
6 changes: 6 additions & 0 deletions crates/top/re_sdk/src/web_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/src/python_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<re_uri::RedapUri>()
.map_err(|err| PyRuntimeError::new_err(err.to_string()))?
else {
return Err(PyRuntimeError::new_err(format!(
"invalid endpoint, expected {:?}",
"invalid endpoint {url:?}, expected {:?}",
"/proxy"
)));
};
Expand Down

0 comments on commit 0e9bf9d

Please sign in to comment.