basws-server

Crates.iobasws-server
lib.rsbasws-server
version0.1.4
sourcesrc
created_at2020-09-15 22:08:11.666983
updated_at2021-02-08 18:33:47.682477
descriptionA simple async WebSocket client/server framework
homepage
repositoryhttps://github.com/khonsulabs/basws
max_upload_size
id289245
size45,183
Jonathan Johnson (ecton)

documentation

README

basws-server

crate version

basws-server is a simple WebSocket framework. For more information, see the basws README.

To set up your own protocol server:

  • Implement the ServerLogic trait
  • Create a Server passing in your ServerLogic implementor
  • In your warp filters, call server.incoming_connection with the websocket during on_upgrade. Make sure to move into closures and clone() as needed. The Server is a reference-counted type, so cloning is cheap.
  • You can use server.send_to_installation_id, server.send_to_account_id, and server.broadcast to communicate out-of-band with clients.

For a full example, check out the chat-server example.

Commit count: 59

cargo fmt