Websocket
Open a WebSocket connection using a Rust client in JavaScript.
Supported Platforms
- Windows
- Linux
- macOS
Setup
This plugin requires a Rust version of at least 1.75
Install the websocket plugin to get started.
Use your project’s package manager to add the dependency:
-
Run the following command in the
src-tauri
folder to add the plugin to the project’s dependencies inCargo.toml
: -
Modify
lib.rs
to initialize the plugin: -
Install the JavaScript Guest bindings using your preferred JavaScript package manager:
Usage
The websocket plugin is available in JavaScript.
Permissions
By default all potentially dangerous plugin commands and scopes are blocked and cannot be accessed. You must modify the permissions in your capabilities
configuration to enable these.
See the Capabilities Overview for more information and the step by step guide to use plugin permissions.
Default Permission
Allows connecting and sending data to a WebSocket server
allow-connect
allow-send
Permission Table
Identifier | Description |
---|---|
|
Enables the connect command without any pre-configured scope. |
|
Denies the connect command without any pre-configured scope. |
|
Enables the send command without any pre-configured scope. |
|
Denies the send command without any pre-configured scope. |
© 2024 Tauri Contributors. CC-BY / MIT