feat: parse and validate events from websockets

Establishes a websocket listener, parses events, and performs
validation to ensure valid signatures.
This commit is contained in:
Greg Heartsfield
2021-12-05 16:53:26 -06:00
parent d0c2b242cd
commit 92e9a5e639
6 changed files with 506 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
//use std::collections::HashMap;
use uuid::Uuid;
// state for a client connection
pub struct ClientConn {
_client_id: Uuid,
// current set of subscriptions
//subscriptions: HashMap<String, Subscription>,
// websocket
//stream: WebSocketStream<TcpStream>,
_max_subs: usize,
}
impl ClientConn {
pub fn new() -> Self {
let client_id = Uuid::new_v4();
ClientConn {
_client_id: client_id,
_max_subs: 128,
}
}
}