tauri-plugin-dev-invoke
Run your Tauri app in a plain browser during development.
Starts a small HTTP server next to your app and routes it through Tauri's real IPC, so
commands, plugin commands, events, channels and convertFileSrc() all work from a browser
tab. Command extractors (State, AppHandle, Window, Webview, Request) and the
capability ACL behave exactly as they do in the webview.
Pair it with the tauri-plugin-dev-invoke-api
npm package, which installs the browser-side shim.
Installation
[]
= "0.3"
Usage
Configure it with Builder:
new
.port
.window
.allow_origin
.build
The network options can also be set at launch, which is how you run several dev instances of the same binary side by side:
| Variable | Overrides |
|---|---|
DEV_INVOKE_HOST |
Builder::host — an IP address, or localhost |
DEV_INVOKE_PORT |
Builder::port |
DEV_INVOKE_ALLOWED_ORIGINS |
Builder::allowed_origins — comma-separated, or * for any |
DEV_INVOKE_PORT=3031
The environment wins over the builder, so a hard-coded .port() can still be overridden at
launch.
Security
- The server only starts in debug builds. Release builds do not contain it unless you
enable the
allow-in-releasefeature and callBuilder::enabled_in_release(true). - It binds to
127.0.0.1and, by default, only answers browsers whose origin matches yourbuild.devUrl. - Anything that reaches the port can run any command your app exposes. Keep it on loopback.
See the repository README for the HTTP API, the full option list and how the callback bridge works.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.