pub async fn greeting<'ws>(
    timeout_duration: Duration,
    _sender: &'ws mut SplitSink<WebSocketStream<TcpStream>, Message>,
    receiver: &'ws mut SplitStream<WebSocketStream<TcpStream>>,
    handler: Pin<Box<dyn Fn(&str) -> Result<(), Error> + Send + Sync + 'static, Global>>
) -> impl Future<Output = Result<(), Error>>
Expand description

Simple greeting handshake where supplied closure receives the first message from the client and should return Ok(()) to proceed or Error to abort the connection.