Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kuyoonjo/tauri-plugin-udp
https://github.com/kuyoonjo/tauri-plugin-udp
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kuyoonjo/tauri-plugin-udp
- Owner: kuyoonjo
- Created: 2024-06-04T04:00:04.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-20T19:15:29.000Z (3 months ago)
- Last Synced: 2024-11-02T07:13:59.253Z (3 months ago)
- Language: Rust
- Size: 578 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- awesome-tauri - tauri-plugin-udp - UDP socket support. (Development / Plugins)
README
# tauri-plugin-udp
This plugin only works with Tauri 2.x only.
## Install
```bash
cargo add tauri-plugin-udp
```
```bash
npm i @kuyoonjo/tauri-plugin-udp
```## Usage
### rust
```rusttauri::Builder::default()
.plugin(tauri_plugin_udp::init())
...
```### javascript
```javascript
import { bind, send } from "@kuyoonjo/tauri-plugin-udp";
import { listen } from "@tauri-apps/api/event";const id = 'unique-id';
await bind(id, '0.0.0.0:8080');
await send(id, '192.168.1.2:9090', 'hello');
await unbind(id);await listen("plugin://udp", (x) => console.log(x.payload));
```
### permissions
add `"udp:default"` into `"permissions"` list of `src-tauri\capabilities\default.json`
```json
{
"$schema": "../gen/schemas/desktop-schema.json",
...
"permissions": [
"core:default",
...
"udp:default"
]
}
```## Support
| MacOS | Linux | Windows |
| ----- | ----- | ------- |
| ✅ | ✅ | ✅ |