diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2022-01-06 17:41:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 17:41:16 +0100 |
commit | 2067820714fea49be1692fa678754488ace8228b (patch) | |
tree | 2decf412d953016a5b4853e77b04f94466a588dc /ext/websocket/lib.rs | |
parent | 46f2ff120587cd1cb7b11e66d41ad6ad46fb09a8 (diff) |
feat(ext/websocket): server automatically handle ping/pong for incoming WebSocket (#13172)
Diffstat (limited to 'ext/websocket/lib.rs')
-rw-r--r-- | ext/websocket/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index 544423066..3e245afbd 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -376,6 +376,7 @@ pub enum SendValue { Text(String), Binary(ZeroCopyBuf), Pong, + Ping, } pub async fn op_ws_send( @@ -387,6 +388,7 @@ pub async fn op_ws_send( SendValue::Text(text) => Message::Text(text), SendValue::Binary(buf) => Message::Binary(buf.to_vec()), SendValue::Pong => Message::Pong(vec![]), + SendValue::Ping => Message::Ping(vec![]), }; let resource = state |