pub fn LocalhostPlugin<R: Runtime>(ServerPort: u16) -> TauriPlugin<R>Expand description
Creates and configures the localhost plugin with CORS headers preconfigured.
§Arguments
ServerPort- The port number for the localhost server
§Returns
A configured tauri_plugin_localhost::TauriPlugin instance.
§CORS Configuration
The plugin is configured with permissive CORS headers to support Service Worker and frontend integration:
- Access-Control-Allow-Origin: * (allows all origins)
- Access-Control-Allow-Methods: GET, POST, OPTIONS, HEAD
- Access-Control-Allow-Headers: Content-Type, Authorization, Origin, Accept