diff --git a/crates/protocol/src/protocol_transport/mod.rs b/crates/protocol/src/protocol_transport/mod.rs index 4fff145dd..8b86d5663 100644 --- a/crates/protocol/src/protocol_transport/mod.rs +++ b/crates/protocol/src/protocol_transport/mod.rs @@ -106,14 +106,14 @@ impl WsConnection for tokio_tungstenite::WebSocketStream) -> Result<(), WsError> { - SinkExt::send(&mut self, tungstenite::Message::Binary(msg)) + SinkExt::send(&mut self, tungstenite::Message::Binary(msg.into())) .await .map_err(|_| WsError::ConnectionClosed) } @@ -130,14 +130,14 @@ impl WsConnection for tokio_tungstenite::WebSocketStream .ok_or(WsError::ConnectionClosed)? .map_err(|e| WsError::ConnectionError(e.to_string()))? { - Ok(msg) + Ok(msg.to_vec()) } else { Err(WsError::UnexpectedMessageType) } } async fn send(&mut self, msg: Vec) -> Result<(), WsError> { - SinkExt::send(&mut self, tungstenite::Message::Binary(msg)) + SinkExt::send(&mut self, tungstenite::Message::Binary(msg.into())) .await .map_err(|_| WsError::ConnectionClosed) }