{"id":15013098,"url":"https://github.com/tauri-apps/tauri-invoke-http","last_synced_at":"2025-10-20T12:43:35.675Z","repository":{"id":43334641,"uuid":"428721870","full_name":"tauri-apps/tauri-invoke-http","owner":"tauri-apps","description":"A custom invoke system for Tauri that leverages a localhost server","archived":false,"fork":false,"pushed_at":"2024-10-19T18:24:05.000Z","size":661,"stargazers_count":55,"open_issues_count":8,"forks_count":7,"subscribers_count":12,"default_branch":"dev","last_synced_at":"2024-10-29T15:44:09.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tauri-apps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.spdx","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-16T16:01:07.000Z","updated_at":"2024-10-28T03:28:10.000Z","dependencies_parsed_at":"2024-03-18T22:05:51.549Z","dependency_job_id":"3790e91c-586b-4187-956b-09e2c66aa5ea","html_url":"https://github.com/tauri-apps/tauri-invoke-http","commit_stats":{"total_commits":22,"total_committers":5,"mean_commits":4.4,"dds":0.6818181818181819,"last_synced_commit":"82d84a0c72195ffc362169706bb081ca77f6f0f2"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-invoke-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-invoke-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-invoke-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-invoke-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tauri-apps","download_url":"https://codeload.github.com/tauri-apps/tauri-invoke-http/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246599317,"owners_count":20803183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:43:44.577Z","updated_at":"2025-09-25T17:19:53.095Z","avatar_url":"https://github.com/tauri-apps.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tauri Invoke HTTP\n\nThis is a crate that provides a custom invoke system for Tauri using a localhost server.\nEach message is delivered through a `XMLHttpRequest` and the server is responsible for replying to it.\n\n## Usage\n\nFirst, add the dependency to your `src-tauri/Cargo.toml` file:\n\n```\n[dependencies]\ntauri-invoke-http = \"0.1\"\n```\n\nThen, setup the HTTP invoke system on the `main.rs` file:\n\n```rust\nfn main() {\n  // initialize the custom invoke system as a HTTP server, allowing the given origins to access it.\n  let http = tauri_invoke_http::Invoke::new(if cfg!(feature = \"custom-protocol\") {\n    [\"tauri://localhost\"]\n  } else {\n    [\"http://localhost:8080\"]\n  });\n  tauri::Builder::default()\n    .invoke_system(http.initialization_script(), http.responder())\n    .setup(move |app| {\n      http.start(app.handle());\n      Ok(())\n    })\n    .run(tauri::generate_context!())\n    .expect(\"error while running tauri application\")\n}\n```\n\nTo invoke a custom command from your own or remote system you can use `curl` or similar tooling.\nSee [`examples/vanilla`](examples/vanilla/) to test this on your system.\n\nAn example command to invoke the `exit` command in the example Tauri app exposing port `18436` (randomly chosen port) could look like:\n\n```sh\ncurl localhost:18436/main -H 'Content-Type: application/json' -d '{ \"__tauriModule\": \"Process\", \"cmd\": \"exit\", \"callback\": 1234, \"error\": 1234, \"message\": {\"cmd\": \"exit\", \"exitCode\": 1  } }'\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Ftauri-invoke-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftauri-apps%2Ftauri-invoke-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Ftauri-invoke-http/lists"}