{"id":15102842,"url":"https://github.com/tauri-apps/tauri-plugin-localhost","last_synced_at":"2025-09-27T00:31:45.571Z","repository":{"id":36996550,"uuid":"427543058","full_name":"tauri-apps/tauri-plugin-localhost","owner":"tauri-apps","description":"[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace","archived":true,"fork":false,"pushed_at":"2023-05-21T13:26:54.000Z","size":673,"stargazers_count":56,"open_issues_count":0,"forks_count":10,"subscribers_count":12,"default_branch":"v1","last_synced_at":"2024-04-23T11:15:40.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/tauri-apps/plugins-workspace","language":"Rust","has_issues":false,"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":null,"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}},"created_at":"2021-11-13T01:45:52.000Z","updated_at":"2023-09-05T07:20:02.000Z","dependencies_parsed_at":"2023-02-17T04:20:30.070Z","dependency_job_id":null,"html_url":"https://github.com/tauri-apps/tauri-plugin-localhost","commit_stats":{"total_commits":2,"total_committers":2,"mean_commits":1.0,"dds":0.5,"last_synced_commit":"8cb17363a524a743702ec5d06264c8cf47fc1927"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-localhost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-localhost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-localhost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-localhost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tauri-apps","download_url":"https://codeload.github.com/tauri-apps/tauri-plugin-localhost/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871553,"owners_count":16554425,"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-25T19:08:07.940Z","updated_at":"2025-09-27T00:31:40.341Z","avatar_url":"https://github.com/tauri-apps.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![plugin-localhost](banner.png)\n\n[DEPRECATED] Please use the plugin from https://github.com/tauri-apps/plugins-workspace instead.\n\nExpose your apps assets through a localhost server instead of the default custom protocol.\n\n\u003e Note: This plugins brings considerable security risks and you should only use it if you know what your are doing. If in doubt, use the default custom protocol implementation.\n\n## Install\n\n_This plugin requires a Rust version of at least **1.64**_\n\nThere are three general methods of installation that we can recommend.\n\n1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)\n2. Pull sources directly from Github using git tags / revision hashes (most secure)\n3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)\n\nInstall the Core plugin by adding the following to your `Cargo.toml` file:\n\n`src-tauri/Cargo.toml`\n\n```toml\n[dependencies]\ntauri-plugin-localhost = { git = \"https://github.com/tauri-apps/plugins-workspace\", branch = \"v1\" }\nportpicker = \"0.1\" # used in the example to pick a random free port\n```\n\n## Usage\n\nFirst you need to register the core plugin with Tauri:\n\n`src-tauri/src/main.rs`\n\n```rust\nuse tauri::{utils::config::AppUrl, window::WindowBuilder, WindowUrl};\n\nfn main() {\n  let port = portpicker::pick_unused_port().expect(\"failed to find unused port\");\n\n  let mut context = tauri::generate_context!();\n  let url = format!(\"http://localhost:{}\", port).parse().unwrap();\n  let window_url = WindowUrl::External(url);\n  // rewrite the config so the IPC is enabled on this URL\n  context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone());\n  context.config_mut().build.dev_path = AppUrl::Url(window_url.clone());\n\n  tauri::Builder::default()\n    .plugin(tauri_plugin_localhost::Builder::new(port).build())\n    .setup(move |app| {\n      WindowBuilder::new(app, \"main\".to_string(), window_url)\n        .title(\"Localhost Example\")\n        .build()?;\n      Ok(())\n    })\n    .run(context)\n    .expect(\"error while running tauri application\");\n}\n```\n\n## Contributing\n\nPRs accepted. Please make sure to read the Contributing Guide before making a pull request.\n\n## License\n\nCode: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.\n\nMIT or MIT/Apache 2.0 where applicable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Ftauri-plugin-localhost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftauri-apps%2Ftauri-plugin-localhost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Ftauri-plugin-localhost/lists"}