mirror of
https://github.com/actix/actix-website
synced 2025-01-22 16:15:56 +01:00
Server section is as good as I'm qualified.
This commit is contained in:
parent
ea7bc84f8d
commit
4291b822fc
@ -9,3 +9,4 @@ actix-rt = "0.2"
|
||||
actix-web = { version = "1.0", features = ["ssl"] }
|
||||
futures = "0.1"
|
||||
openssl = "0.10"
|
||||
actix-http = "0.2"
|
||||
|
@ -2,19 +2,21 @@
|
||||
use actix_web::{web, App, HttpResponse, HttpServer};
|
||||
|
||||
pub fn main() {
|
||||
HttpServer::new(|| {
|
||||
let one = 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.
|
||||
// let _two = HttpServer::new(|| {
|
||||
// App::new().route("/", web::get().to(|| HttpResponse::Ok()))
|
||||
// })
|
||||
// .keep_alive(); // <- Use `SO_KEEPALIVE` socket option.
|
||||
|
||||
HttpServer::new(|| {
|
||||
let _three = HttpServer::new(|| {
|
||||
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
|
||||
})
|
||||
.keep_alive(None); // <- Disable keep-alive
|
||||
|
||||
one.bind("127.0.0.1:8088").unwrap().run().unwrap();
|
||||
}
|
||||
// </keep-alive>
|
||||
|
@ -8,3 +8,6 @@ pub fn index(req: HttpRequest) -> HttpResponse {
|
||||
.finish()
|
||||
}
|
||||
// </example>
|
||||
// ConnectionType::Close
|
||||
// ConnectionType::KeepAlive
|
||||
// ConnectionType::Upgrade
|
||||
|
@ -1,4 +1,4 @@
|
||||
// pub mod keep_alive;
|
||||
pub mod keep_alive;
|
||||
// pub mod keep_alive_tp;
|
||||
pub mod signals;
|
||||
pub mod ssl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user