1
0
mirror of https://github.com/actix/actix-website synced 2025-01-23 08:34:35 +01:00

21 lines
596 B
Rust
Raw Normal View History

2019-06-13 17:10:51 -04:00
// <keep-alive>
use actix_web::{web, App, HttpResponse, HttpServer};
pub fn main() {
2019-06-13 17:10:51 -04:00
HttpServer::new(|| {
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
})
.keep_alive(75); // <- Set keep-alive to 75 seconds
HttpServer::new(|| {
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
})
.keep_alive(server::KeepAlive::Tcp(75)); // <- Use `SO_KEEPALIVE` socket option.
HttpServer::new(|| {
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
})
.keep_alive(None); // <- Disable keep-alive
}
// </keep-alive>