2025-06-15 11:47:50 +02:00
2024-09-16 07:21:06 -03:00
2021-11-16 13:01:34 -03:00
2021-11-16 13:01:34 -03:00
2021-11-16 13:01:34 -03:00
2021-11-16 13:01:34 -03:00
2024-09-17 12:53:30 -03:00
2022-06-26 08:58:25 +00:00
2021-11-16 13:01:34 -03:00

Tauri Invoke HTTP

This is a crate that provides a custom invoke system for Tauri using a localhost server. Each message is delivered through a XMLHttpRequest and the server is responsible for replying to it.

Usage

First, add the dependency to your src-tauri/Cargo.toml file:

[dependencies]
tauri-invoke-http = "0.1"

Then, setup the HTTP invoke system on the main.rs file:

fn main() {
  // initialize the custom invoke system as a HTTP server, allowing the given origins to access it.
  let http = tauri_invoke_http::Invoke::new(if cfg!(feature = "custom-protocol") {
    ["tauri://localhost"]
  } else {
    ["http://localhost:8080"]
  });
  tauri::Builder::default()
    .invoke_system(http.initialization_script())
    .setup(move |app| {
      http.start(app.handle());
      Ok(())
    })
    .run(tauri::generate_context!())
    .expect("error while running tauri application")
}

See examples/vanilla to see the custom invoke system in practice.

Description
⚠️ ARCHIVED: Original GitHub repository no longer exists. Preserved as backup on 2026-01-31T05:33:15.252Z
Readme 808 KiB
Languages
Rust 100%