When to use this skill
ALWAYS use this skill when the user mentions:
- Accessing localhost services from the app / 应用访问本地服务
- Local server exposure and safety / 本地服务暴露与安全
- Dev vs production localhost behavior / 开发与生产本地行为
Trigger phrases include:
- "localhost", "local service", "dev server", "ports"
- "local service", "localhost", "port", "dev server"
How to use this skill
- Identify local services and their access requirements
- Configure localhost plugin capabilities and allowed ports
- Separate dev-mode access from production constraints
- Validate minimal exposure and audit access patterns
Outputs
- Localhost access policy / 本地服务访问策略
- Dev/prod separation checklist / 开发生产分离清单
Scope
- Boundary: Localhost plugin usage only
- Key points: Controlled access and environment separation
References
- https://v2.tauri.app/llms.txt
- https://v2.tauri.app/plugin/localhost/
- https://v2.tauri.app/zh-cn/plugin/localhost/
Keywords
tauri localhost, local service, dev server, security
Common Gotchas (Gotchas)
- Version compatibility: Pay attention to the compatibility between the framework version and dependency libraries; APIs may differ across versions.
- Configuration file format: Configuration file format errors are the most common problem; it is recommended to use the editor's syntax check.
- Environment variables: Ensure all necessary environment variables are set correctly, and do not hard-code sensitive information.
- Dependency conflicts: When multiple versions coexist, pay attention to dependency conflicts and use a lock file to lock versions.
- Performance pitfalls: Pay attention to performance optimization in large-data scenarios, and avoid common problems such as N+1 queries.
Usage workflow
Step 1: Environment preparation
Ensure the development environment has the necessary dependencies and tools installed.
Step 2: Configuration initialization
Perform basic configuration according to project requirements.
Step 3: Using core features
Implement core functionality according to the example code.
Step 4: Test verification
Run tests to ensure functionality works properly.
Step 5: Deploy to production
After development is complete, deploy and monitor.