Basic implementation of websocket
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::time::Duration;
|
||||
|
||||
/// Auth header
|
||||
pub const API_AUTH_HEADER: &str = "x-client-auth";
|
||||
|
||||
@@ -16,3 +18,11 @@ pub mod sessions {
|
||||
/// Authenticated ID
|
||||
pub const USER_ID: &str = "uid";
|
||||
}
|
||||
|
||||
/// 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);
|
||||
|
||||
Reference in New Issue
Block a user