Crates.io | degen-websockets |
lib.rs | degen-websockets |
version | 0.2.5 |
source | src |
created_at | 2023-07-24 00:13:44.220261 |
updated_at | 2023-07-24 04:31:45.177398 |
description | Yet Another WebSocket Server |
homepage | |
repository | https://github.com/ethereumdegen/degen-websockets |
max_upload_size | |
id | 924094 |
size | 84,620 |
A websocket server and client framework supporting:
Reliable messaging (option)
Broadcast-to-all, Specific-destination or Room-based destinations for messages
cargo add degen-websockets
See main.rs
You can define your own inner messages to send through the socket server. They just need to implement Serialize/Deserialize and MessageReliability as follows:
#[derive(Serialize,Deserialize)]
struct MyCustomMessage {
color: String
}
impl MessageReliability for MyCustomMessage {
fn get_reliability_type(&self, msg_uuid:String) -> MessageReliabilityType{
return MessageReliabilityType::Reliable( msg_uuid )
}
}