use diesel::PgConnection;
use lemmy_server::{
rate_limit::{rate_limiter::RateLimiter, RateLimit},
- routes::{api, federation, feeds, index, nodeinfo, webfinger, websocket},
+ routes::{api, federation, feeds, index, nodeinfo, webfinger},
settings::Settings,
websocket::server::*,
};
.configure(index::config)
.configure(nodeinfo::config)
.configure(webfinger::config)
- .configure(websocket::config)
// static files
.service(actix_files::Files::new(
"/static",
use crate::websocket::server::*;
use actix_web::{Error, Result};
-pub fn config(cfg: &mut web::ServiceConfig) {
- cfg.service(web::resource("/api/v1/ws").to(chat_route));
-}
-
/// How often heartbeat pings are sent
const HEARTBEAT_INTERVAL: Duration = Duration::from_secs(5);
/// How long before lack of client response causes a timeout
const CLIENT_TIMEOUT: Duration = Duration::from_secs(10);
/// Entry point for our route
-async fn chat_route(
+pub async fn chat_route(
req: HttpRequest,
stream: web::Payload,
chat_server: web::Data<Addr<ChatServer>>,