Skip to content

Commit b2a47dc

Browse files
committed
Revert "use localhost for tauri"
This reverts commit 04dcc96.
1 parent 8930939 commit b2a47dc

File tree

3 files changed

+4
-84
lines changed

3 files changed

+4
-84
lines changed

src-tauri/Cargo.lock

Lines changed: 3 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ tauri-build = { version = "1.5.0", features = [] }
1818
serde_json = "1.0"
1919
serde = { version = "1.0", features = ["derive"] }
2020
tauri = { version = "1.5.3", features = [ "macos-private-api", "system-tray", "shell-open"] }
21-
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
22-
portpicker = "0.1"
2321

2422
[features]
2523
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.

src-tauri/src/main.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,12 @@ use tauri::{
77
SystemTrayEvent,
88
SystemTrayMenu,
99
SystemTrayMenuItem,
10-
utils::config::AppUrl,
11-
WindowUrl,
1210
};
1311
use tauri::Manager;
1412

1513

1614
fn main() {
17-
let port = portpicker::pick_unused_port().expect("failed to find unused port");
18-
19-
let mut context = tauri::generate_context!();
20-
let url = format!("http://localhost:{}", port).parse().unwrap();
21-
let window_url = WindowUrl::External(url);
22-
// rewrite the config so the IPC is enabled on this URL
23-
context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone());
24-
25-
2615
tauri::Builder::default()
27-
.plugin(tauri_plugin_localhost::Builder::new(port).build())
2816
.system_tray(SystemTray::new()
2917
.with_menu(SystemTrayMenu::new()
3018
.add_item(CustomMenuItem::new("checkforupdates".to_string(), "Check for updates"))
@@ -51,6 +39,6 @@ fn main() {
5139
}
5240
_ => {}
5341
})
54-
.run(context)
42+
.run(tauri::generate_context!())
5543
.expect("error while running tauri application");
5644
}

0 commit comments

Comments
 (0)