summaryrefslogtreecommitdiff
path: root/ext/websocket/lib.rs
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2022-01-06 17:41:16 +0100
committerGitHub <noreply@github.com>2022-01-06 17:41:16 +0100
commit2067820714fea49be1692fa678754488ace8228b (patch)
tree2decf412d953016a5b4853e77b04f94466a588dc /ext/websocket/lib.rs
parent46f2ff120587cd1cb7b11e66d41ad6ad46fb09a8 (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.rs2
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