Skip to content

Configuration

The remote UI server is configured with RemoteUiConfig, a builder you pass to start_remote_ui. Start from RemoteUiConfig::default() and chain the builder methods you need.

use tauri_remote_ui::{OriginType, RemoteUiConfig, RemoteUiExt};
app.start_remote_ui(
RemoteUiConfig::default()
.set_port(Some(9090))
.set_allowed_origin(OriginType::Subnet)
.minimize_app(),
)
.await?;
FieldDefaultMeaning
allowed_originOriginType::LocalhostOnly the local machine may connect.
portNoneOS picks a free port.
bundle_pathNoneFalls back to frontendDist, then ../dist.
primary_window_label"main"Window the remote UI controls.
application_uifalseNative window shows the blocking screen.
minimize_appfalseHost window is not minimized on start.
enable_info_urltrue/remote_ui_info endpoint is available.
custom_blocking_uiNoneBuilt-in blocking screen is used.
custom_disconnect_uiNoneBuilt-in disconnect screen is used.
RemoteUiConfig::default().set_port(Some(9090))

Sets the TCP port to listen on. Pass None (default) to let the OS choose a free port; read it back afterwards with app.remote_ui_port().await.

RemoteUiConfig::default().set_allowed_origin(OriginType::Subnet)

Controls who may connect. See Security for the full breakdown of OriginType (Localhost, Subnet, Any).

RemoteUiConfig::default().set_bundle_path(Some("../dist".into()))

Overrides the static asset directory served to remote clients. Defaults to the Tauri-configured frontendDist, falling back to ../dist.

RemoteUiConfig::default().set_primary_window_label("main")

The label of the Tauri webview window the remote UI controls and replaces. Defaults to "main".

RemoteUiConfig::default().enable_application_ui()

Keeps the native Tauri UI active and lets it navigate alongside the remote client, instead of replacing it with the blocking screen. Useful when you want to drive the app from a browser while still watching the desktop window.

RemoteUiConfig::default().minimize_app()

Minimizes the host Tauri window when the server starts.

RemoteUiConfig::default().disable_info_url()

Disables the /remote_ui_info endpoint; requests to it then return 404 Not Found.

RemoteUiConfig::default().set_custom_blocking_ui(Some(html))

Injects custom HTML/CSS/JS shown on the host window while a remote session is active. The following placeholders are substituted before injection:

PlaceholderReplaced with
%URLS%Comma-separated list of every reachable URL.
%URLS_LIST%Pre-rendered <li><a href="…">…</a></li> items for a <ul>/<ol>.
%URL_INFO%The /remote_ui_info URL.
RemoteUiConfig::default().set_custom_disconnect_ui(Some(html))

Injects custom HTML/CSS/JS shown in the remote browser tab once the connection closes.

RemoteUiConfig exposes getters for inspection: allowed_origin(), port(), bundle_path() and primary_window_label().