1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 05:10:36 +02:00

add name to service registration

This commit is contained in:
Nikolay Kim
2018-09-17 20:19:48 -07:00
parent 4827990298
commit ed23caa314
7 changed files with 72 additions and 31 deletions

View File

@ -3,17 +3,18 @@
//! to test: curl https://127.0.0.1:8443/ -k
extern crate actix;
extern crate actix_net;
extern crate env_logger;
extern crate futures;
extern crate openssl;
extern crate tokio_io;
extern crate tokio_openssl;
extern crate tokio_tcp;
use std::fmt;
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use std::{env, fmt};
use futures::{future, Future};
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
@ -48,6 +49,9 @@ fn service<T: AsyncRead + AsyncWrite>(
}
fn main() {
env::set_var("RUST_LOG", "actix_net=trace");
env_logger::init();
let sys = actix::System::new("test");
// load ssl keys
@ -68,6 +72,7 @@ fn main() {
Server::default()
.bind(
// configure service pipeline
"basic",
"0.0.0.0:8443",
move || {
let num = num.clone();

View File

@ -48,7 +48,7 @@ fn main() {
// server start mutiple workers, it runs supplied `Fn` in each worker.
Server::default()
.bind("0.0.0.0:8443", move || {
.bind("test-ssl", "0.0.0.0:8443", move || {
let num = num.clone();
// configure service