basws

A simple async WebSocket client/server framework


Keywords
websocket, tokio
License
MIT

Documentation

basws

crate version

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.

Features

  • Built atop cbor, which has many implementations in various technology stacks
  • Basic support for one account logging in on multiple devices
  • Easy out-of-band async message sending
  • Provides network timing statistics on both the server and client

For a simple example, check out chat example in the ./basws/examples directory.

Usage

Server

Add either of these lines to your Cargo.toml:

# Either use the basws parent crate
basws = { version = ">=0.1.0-dev-4", features = ["server"] }
# Or, use the basws-server crate
basws-server = ">=0.1.0-dev-4"

Client

Add either of these lines to your Cargo.toml:

# Either use the basws parent crate
basws = { version = ">=0.1.0-dev-4", features = ["client"] }
# Or, use the basws-client crate
basws-client = ">=0.1.0-dev-4"