lirays
Rust client for LiRAYS-SCADA WebSocket + protobuf protocol.
Install
Cargo.toml:
[]
= "0.1"
Authentication model
This client supports authentication using a PAT token generated by lirays (generate-admin-token / generate-operator-token).
The PAT is sent as:
Authorization: Bearer <pat_token>during WebSocket upgrade.
Connection methods
Use the method that matches your server auth configuration:
Client::connect(host, port, tls)for unauthenticated servers.Client::connect_with_pat(host, port, tls, pat_token)for authenticated servers (sendsAuthorization: Bearer <pat_token>).Client::connect_with_options(ConnectionOptions)when you want explicit control over all connection fields.
Unauthenticated
use Client;
async
All command APIs accept a timeout_ms parameter and return ClientError::Timeout when the response is not received in time.
Authenticated (PAT)
use Client;
async
Quick start
use Client;
async
Main capabilities
- Namespace CRUD: create folders, create variables, list, delete.
- Typed value writes/reads: integer, float, text, boolean.
- Metadata updates via
edit_variable_metadata. - Bulk namespace creation from JSON schema (
create_bulk_from_json). - Realtime subscriptions (
subscribe_var_values).
Development
Run demos: