From 8c8eb2464402d8b3c016c887c7d87b33cac45a36 Mon Sep 17 00:00:00 2001 From: jprochazk <1665677+jprochazk@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:11:55 +0100 Subject: [PATCH] replace more urls --- crates/store/re_grpc_server/src/lib.rs | 2 +- crates/top/re_sdk/src/lib.rs | 2 +- crates/top/re_sdk/src/recording_stream.rs | 9 ++++++--- rerun_py/src/python_bridge.rs | 3 +-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/store/re_grpc_server/src/lib.rs b/crates/store/re_grpc_server/src/lib.rs index e0f8bbf4372b..ec968527d04c 100644 --- a/crates/store/re_grpc_server/src/lib.rs +++ b/crates/store/re_grpc_server/src/lib.rs @@ -68,7 +68,7 @@ async fn serve_impl( let incoming = TcpIncoming::from_listener(tcp_listener, true, None).expect("failed to init listener"); - re_log::info!("Listening for gRPC connections on http://{addr}"); + re_log::info!("Listening for gRPC connections on {addr}"); let cors = CorsLayer::very_permissive(); let grpc_web = tonic_web::GrpcWebLayer::new(); diff --git a/crates/top/re_sdk/src/lib.rs b/crates/top/re_sdk/src/lib.rs index 36dfdff28e6c..44a1f487fffb 100644 --- a/crates/top/re_sdk/src/lib.rs +++ b/crates/top/re_sdk/src/lib.rs @@ -40,7 +40,7 @@ pub const DEFAULT_SERVER_PORT: u16 = 9876; /// /// This isn't used to _host_ the server, only to _connect_ to it. pub const DEFAULT_CONNECT_URL: &str = - const_format::concatcp!("http://127.0.0.1:{DEFAULT_SERVER_PORT}"); + const_format::concatcp!("rerun+http://127.0.0.1:{DEFAULT_SERVER_PORT}"); /// The default address of a Rerun TCP server which an SDK connects to. #[deprecated(since = "0.22.0", note = "migrate to connect_grpc")] diff --git a/crates/top/re_sdk/src/recording_stream.rs b/crates/top/re_sdk/src/recording_stream.rs index f93e5aa25d62..3a09d3ed949b 100644 --- a/crates/top/re_sdk/src/recording_stream.rs +++ b/crates/top/re_sdk/src/recording_stream.rs @@ -517,7 +517,7 @@ impl RecordingStreamBuilder { return Ok(RecordingStream::disabled()); } - let url = format!("http://{}", opts.connect_addr()); + let url = format!("rerun+http://{}", opts.connect_addr()); // NOTE: If `_RERUN_TEST_FORCE_SAVE` is set, all recording streams will write to disk no matter // what, thus spawning a viewer is pointless (and probably not intended). @@ -1724,7 +1724,7 @@ impl RecordingStream { #[deprecated(since = "0.22.0", note = "use connect_grpc() instead")] pub fn connect_opts(&self, addr: std::net::SocketAddr, flush_timeout: Option) { let _ = flush_timeout; - self.connect_grpc_opts(format!("http://{addr}"), flush_timeout) + self.connect_grpc_opts(format!("rerun+http://{addr}"), flush_timeout) .expect("failed to connect via gRPC"); } @@ -1827,7 +1827,10 @@ impl RecordingStream { crate::spawn(opts)?; - self.connect_grpc_opts(format!("http://{}", opts.connect_addr()), flush_timeout)?; + self.connect_grpc_opts( + format!("rerun+http://{}", opts.connect_addr()), + flush_timeout, + )?; Ok(()) } diff --git a/rerun_py/src/python_bridge.rs b/rerun_py/src/python_bridge.rs index 6f13f5d35b44..7d62628fe49e 100644 --- a/rerun_py/src/python_bridge.rs +++ b/rerun_py/src/python_bridge.rs @@ -597,8 +597,7 @@ fn connect_grpc( return Ok(()); }; - 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 url = url.unwrap_or_else(|| re_sdk::DEFAULT_CONNECT_URL.to_owned()); let endpoint = url .parse::() .map_err(|err| PyRuntimeError::new_err(err.to_string()))?;