diff --git a/server/src/route.rs b/server/src/route.rs index 08ee608..ace7d44 100644 --- a/server/src/route.rs +++ b/server/src/route.rs @@ -111,6 +111,7 @@ pub async fn route( ws_upgrade(req, |fut, wsproxy, udp, path| async move { let mut ws = fut.await.context("failed to await upgrade future")?; ws.set_max_message_size(CONFIG.server.max_message_size); + ws.set_auto_pong(false); if wsproxy { let ws = WebSocketStreamWrapper(FragmentCollector::new(ws)); diff --git a/wisp/src/inner.rs b/wisp/src/inner.rs index 4bbae67..7cdb330 100644 --- a/wisp/src/inner.rs +++ b/wisp/src/inner.rs @@ -27,6 +27,7 @@ pub(crate) enum WsEvent { SendPong(Payload<'static>), WispMessage(Option>, Option>), EndFut(Option), + Noop } struct MuxMapValue { @@ -238,6 +239,8 @@ impl MuxInner { return Ok(None); } else if frame.opcode == OpCode::Ping { return Ok(Some(WsEvent::SendPong(frame.payload))); + } else if frame.opcode == OpCode::Pong { + return Ok(Some(WsEvent::Noop)); } if let Some(ref extra_frame) = optional_frame { @@ -342,6 +345,7 @@ impl MuxInner { } } } + WsEvent::Noop => {} } }