Add basic ping-pong websocket

This commit is contained in:
2025-02-06 21:40:11 +01:00
parent c573d2f74a
commit 4ff72e073e
6 changed files with 151 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
use std::time::Duration;
/// Session key for OpenID login state
pub const STATE_KEY: &str = "oidc-state";
@@ -6,3 +8,11 @@ pub const USER_SESSION_KEY: &str = "user";
/// Token length
pub const TOKEN_LEN: usize = 20;
/// How often heartbeat pings are sent.
///
/// Should be half (or less) of the acceptable client timeout.
pub const WS_HEARTBEAT_INTERVAL: Duration = Duration::from_secs(5);
/// How long before lack of client response causes a timeout.
pub const WS_CLIENT_TIMEOUT: Duration = Duration::from_secs(10);