From 73a1f9b696a86ced61312496f7f179106f2c062f Mon Sep 17 00:00:00 2001 From: eauxxs Date: Sun, 3 Dec 2023 12:29:38 +0800 Subject: [PATCH] fix webstream do not flush data --- src/proxy/websocket/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/proxy/websocket/mod.rs b/src/proxy/websocket/mod.rs index 5f988795..6d2d2145 100644 --- a/src/proxy/websocket/mod.rs +++ b/src/proxy/websocket/mod.rs @@ -91,6 +91,10 @@ impl AsyncWrite for BinaryWsStream { Pin::new(&mut self.inner) .start_send(message) .map_err(|e| io::Error::new(io::ErrorKind::Other, format!("{:?}", e)))?; + + Pin::new(&mut self.inner) + .poll_flush(cx) + .map_err(|e| io::Error::new(io::ErrorKind::Other, format!("{:?}", e)))?; Poll::Ready(Ok(buf.len())) }