{"id":15047037,"url":"https://github.com/idootop/tauri-plugin-cors-fetch","last_synced_at":"2026-01-20T14:04:52.290Z","repository":{"id":229329515,"uuid":"776420289","full_name":"idootop/tauri-plugin-cors-fetch","owner":"idootop","description":"Enabling Cross-Origin Resource Sharing (CORS) for Fetch Requests within Tauri applications.","archived":false,"fork":false,"pushed_at":"2025-06-28T12:42:22.000Z","size":770,"stargazers_count":17,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-20T16:54:50.267Z","etag":null,"topics":["cors","fetch","tauri","unofficial-tauri-plugin"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/tauri-plugin-cors-fetch","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idootop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-03-23T13:09:49.000Z","updated_at":"2025-12-18T05:04:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"049f379d-9be7-4895-af9e-6104c7ef60f6","html_url":"https://github.com/idootop/tauri-plugin-cors-fetch","commit_stats":null,"previous_names":["idootop/tauri-plugin-cors-fetch"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/idootop/tauri-plugin-cors-fetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idootop%2Ftauri-plugin-cors-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idootop%2Ftauri-plugin-cors-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idootop%2Ftauri-plugin-cors-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idootop%2Ftauri-plugin-cors-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idootop","download_url":"https://codeload.github.com/idootop/tauri-plugin-cors-fetch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idootop%2Ftauri-plugin-cors-fetch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28604712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T12:01:53.233Z","status":"ssl_error","status_checked_at":"2026-01-20T12:01:46.545Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cors","fetch","tauri","unofficial-tauri-plugin"],"created_at":"2024-09-24T20:53:53.961Z","updated_at":"2026-01-20T14:04:52.284Z","avatar_url":"https://github.com/idootop.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![tauri-plugin-cors-fetch](https://github.com/idootop/tauri-plugin-cors-fetch/raw/main/banner.png)\n\n[![crates.io](https://img.shields.io/crates/v/tauri-plugin-cors-fetch.svg)](https://crates.io/crates/tauri-plugin-cors-fetch)\n[![Download](https://img.shields.io/crates/d/tauri-plugin-cors-fetch.svg)](https://crates.io/crates/tauri-plugin-cors-fetch)\n[![MIT licensed](https://img.shields.io/crates/l/tauri-plugin-cors-fetch.svg)](./LICENSE)\n[![Documentation](https://docs.rs/tauri-plugin-cors-fetch/badge.svg)](https://docs.rs/crate/tauri-plugin-cors-fetch)\n\nAn **unofficial** Tauri plugin that enables **seamless cross-origin (CORS) requests** by transparently proxying the native `fetch` API through Tauri's HTTP client.\n\n## Features\n\n- **Zero Code Change**: Use standard `fetch()` as you normally would.\n- **Transparent Proxying**: Automatically hooks into the browser's fetch.\n- **Configurable**: Granular control over which domains bypass CORS.\n- **Multi-platform**: Supports _Windows, macOS, Linux, iOS, and Android_.\n\n## Quick Start\n\n**1. Install Dependencies**\n\nAdd the plugin to your `Cargo.toml`:\n\n```shell\n# src-tauri\ncargo add tauri-plugin-cors-fetch\n```\n\n**2. Initialize Plugin**\n\nRegister the plugin in your Tauri setup:\n\n```rust\n// src-tauri/src/lib.rs\npub fn run() {\n    tauri::Builder::default()\n        .plugin(tauri_plugin_cors_fetch::init()) // 👈 here\n        .run(tauri::generate_context!())\n        .expect(\"failed to run app\");\n}\n```\n\n**3. Configure Permissions \u0026 Settings**\n\nAdd the required permission to your capability file:\n\n```json\n// src-tauri/capabilities/default.json\n{\n  \"permissions\": [\"cors-fetch:default\"]\n}\n```\n\nEnsure `withGlobalTauri` is enabled in `tauri.conf.json`:\n\n```json\n// src-tauri/tauri.conf.json\n{\n  \"app\": {\n    \"withGlobalTauri\": true\n  }\n}\n```\n\n## Usage\n\nOnce initialized, the plugin automatically hooks into the global `fetch`. No changes to your frontend code are required:\n\n```javascript\n// This request now bypasses CORS automatically\nconst response = await fetch(\"https://api.openai.com\");\nconst data = await response.json();\n```\n\n### Configuration\n\nYou can fine-tune the behavior via `window.CORSFetch.config()`:\n\n```javascript\nwindow.CORSFetch.config({\n  include: [/^https?:\\/\\//i], // Patterns to proxy (default: all)\n  exclude: [\"https://api.openai.com/v1/chat/completions\"],\n  // Default request options for Tauri HTTP Client\n  request: {\n    connectTimeout: 30 * 1000, // ms\n    maxRedirections: 5,\n    proxy: { all: \"http://127.0.0.1:7890\" },\n  },\n});\n```\n\n### Direct Access APIs\n\n- `window.fetchCORS(url, init)`: Explicitly use the CORS-bypassing fetch.\n- `window.fetchNative(url, init)`: Use the original browser fetch (subject to CORS).\n\n## Limitations\n\n- **Fetch Only**: Does not support `XMLHttpRequest` (XHR).\n- **No Streaming**: Server-Sent Events (SSE) and response streaming are currently not supported.\n\n## License\n\nMIT License © 2024-PRESENT [Del Wang](https://del.wang)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidootop%2Ftauri-plugin-cors-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidootop%2Ftauri-plugin-cors-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidootop%2Ftauri-plugin-cors-fetch/lists"}