mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-24 01:11:07 +01:00
add helper fn
This commit is contained in:
parent
8ad93f4838
commit
9577b7bbed
@ -13,7 +13,7 @@ Actix net - framework for composable network services (experimental)
|
|||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn main() {
|
fn main() {
|
||||||
let sys = actix::System::new("test");
|
let sys = actix_rt::System::new("test");
|
||||||
|
|
||||||
// load ssl keys
|
// load ssl keys
|
||||||
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
|
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
|
||||||
@ -26,7 +26,7 @@ fn main() {
|
|||||||
// bind socket address and start workers. By default server uses number of
|
// bind socket address and start workers. By default server uses number of
|
||||||
// available logical cpu as threads count. actix net start separate
|
// available logical cpu as threads count. actix net start separate
|
||||||
// instances of service pipeline in each worker.
|
// instances of service pipeline in each worker.
|
||||||
Server::default()
|
actix_server::build()
|
||||||
.bind(
|
.bind(
|
||||||
// configure service pipeline
|
// configure service pipeline
|
||||||
"basic", "0.0.0.0:8443",
|
"basic", "0.0.0.0:8443",
|
||||||
|
@ -25,3 +25,8 @@ impl Token {
|
|||||||
token
|
token
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Start server building process
|
||||||
|
pub fn build() -> ServerBuilder {
|
||||||
|
ServerBuilder::default()
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user