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:
-
Install the websocket plugin by adding the following to your
Cargo.toml
file: -
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 plugin commands are blocked and cannot be accessed. You must define a list of permissions in your capabilities
configuration.
See Permissions Overview for more information.
Permission | Description |
---|---|
websocket:default | Allows connecting and sending data to a WebSocket server |
websocket:allow-connect | Enables the connect command without any pre-configured scope. |
websocket:deny-connect | Denies the connect command without any pre-configured scope. |
websocket:allow-send | Enables the send command without any pre-configured scope. |
websocket:deny-send | Denies the send command without any pre-configured scope. |
© 2024 Tauri Contributors. CC-BY / MIT