chomnr / brute

Brute an application that monitors authentication attempts on your server that uses OpenSSH or any protocol. May not be practical, but it is cool.
https://brute.exposed/
MIT License
18 stars 5 forks source link

websocket message loss #4

Open chomnr opened 1 month ago

chomnr commented 1 month ago

when receiving messages over a websocket not all the messages reach their destination.

'http/mod.rs'

pub fn broadcast<T: Serialize>(parse_type: ParseType, message: T) {
    for (_, session) in CLIENTS.lock().unwrap().clone().into_iter() {
        let message=BruteMessage: :new::<T>(parse_type.clone(),
                serde_json::to_string(&message).unwrap(),
            );
        session.do_send(message) // might be this....
    }
}
chomnr commented 1 month ago

https://stackoverflow.com/questions/28582935/does-http-2-make-websockets-obsolete

TODO: switch to Event Streaming.

but keep websockets as an alternative.

chomnr commented 1 month ago

probably is my nginx configuration i don't lose any messages locally.

chomnr commented 1 month ago

Don't think the websockets lose any messages it looks like the message eventually do go through. but the message doesn't come in until a new message comes through. it's like really weird not sure how to describe it.