#Websockets not connecting on ws protocol

1 messages · Page 1 of 1 (latest)

frank lodge
#

but reserve /ws/ for websocket communication

frank lodge
#
#[actix_web::main]
pub async fn spawn_server(settings: Settings) -> std::io::Result<()> {
    let address = ("127.0.0.1", settings.read_config::<u16>("port")); // the address is a tuple

    let wrapper = NormalizePath::new(TrailingSlash::Always).use_redirects();

    let server = HttpServer::new(move || App::new().route("/ws", web::get().to(websocket_connect)))
        .bind(address)?
        .run();

    let (ip, port) = address;
    match open::that(format!("http://{}:{}", ip, port)) {
        Ok(_) => {}

        Err(error) => error::handle_error("Failed to open overlay in browser!", error),
    }

    server.await
}
#

this seems to work

#

but I'm not serving files