Crates.io | basws |
lib.rs | basws |
version | 0.1.4 |
source | src |
created_at | 2020-09-15 22:09:15.612246 |
updated_at | 2021-02-08 18:35:08.732133 |
description | A simple async WebSocket client/server framework |
homepage | |
repository | https://github.com/khonsulabs/basws |
max_upload_size | |
id | 289246 |
size | 74,143 |
basws is a simple framework that aims to simplify the amount of code required to build an interactive WebSocket API.
basws is built atop warp on the server, and tokio-tungstenite on the client. Both crates utilize the tokio runtime.
For a simple example, check out chat example in the ./basws/examples directory.
Add either of these lines to your Cargo.toml:
# Either use the basws parent crate
basws = { version = "0.1", features = ["server"] }
# Or, use the basws-server crate
basws-server = "0.1"
Add either of these lines to your Cargo.toml:
# Either use the basws parent crate
basws = { version = "0.1", features = ["client"] }
# Or, use the basws-client crate
basws-client = "0.1"
Add either of these lines to your Cargo.toml:
# Either use the basws parent crate
basws = { version = "0.1", features = ["yew"] }
# Or, use the basws-client crate
basws-yew = "0.1"
When building for release, an environment variable needs to be present: BASWS_CLIENT_ENCRYPTION_KEY
. This should be a 32-character string. It is used to encrypt the session information stored in the browser. If you ever suspect that you need to invalidate existing session information, rotating this key will cause every user to start a new session.