When to use this skill
ALWAYS use this skill when the user mentions:
- Serving frontend via localhost in a Tauri app
- Local server exposure and port configuration
- Dev vs production localhost behavior differences
Trigger phrases include:
- "localhost", "local server", "localhost plugin", "port", "serve frontend"
How to use this skill
- Install the localhost plugin:
cargo add tauri-plugin-localhost - Register the plugin with a specific port in your Tauri builder:
tauri::Builder::default() .plugin(tauri_plugin_localhost::Builder::new(3030).build()) - Configure the frontend URL in
tauri.conf.jsonfor production:{ "build": { "frontendDist": "../dist" } } - Bind only to 127.0.0.1 to prevent external access to the local server
- Separate dev-mode access (Vite dev server on port 5173) from production (localhost plugin on a fixed port)
- Audit access patterns to ensure minimal exposure in production builds
Outputs
- Localhost plugin configuration with fixed port
- Dev vs production server separation
- Security checklist for minimal exposure
References
- https://v2.tauri.app/plugin/localhost/
Keywords
tauri localhost, local server, port, serve frontend, dev server