mirror of
https://github.com/actix/actix-web.git
synced 2024-12-20 23:26:44 +00:00
update actix-server dep
This commit is contained in:
parent
409888fcd5
commit
402a40ab27
5 changed files with 14 additions and 9 deletions
|
@ -38,11 +38,11 @@ ssl = ["openssl", "actix-connector/ssl"]
|
|||
fail = ["failure"]
|
||||
|
||||
[dependencies]
|
||||
actix-service = "0.3.3"
|
||||
actix-service = "0.3.4"
|
||||
actix-codec = "0.1.1"
|
||||
actix-connector = "0.3.0"
|
||||
actix-utils = "0.3.3"
|
||||
actix-server-config = { git="https://github.com/actix/actix-net.git" }
|
||||
actix-utils = "0.3.4"
|
||||
actix-server-config = "0.1.0"
|
||||
|
||||
base64 = "0.10"
|
||||
backtrace = "0.3"
|
||||
|
@ -91,3 +91,4 @@ actix-http-test = { path="test-server", features=["ssl"] }
|
|||
env_logger = "0.6"
|
||||
serde_derive = "1.0"
|
||||
openssl = { version="0.10" }
|
||||
tokio-tcp = "0.1"
|
|
@ -7,6 +7,7 @@ use actix_service::{fn_service, NewService};
|
|||
use actix_utils::framed::IntoFramed;
|
||||
use actix_utils::stream::TakeItem;
|
||||
use futures::Future;
|
||||
use tokio_tcp::TcpStream;
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
env::set_var("RUST_LOG", "framed_hello=info");
|
||||
|
@ -14,7 +15,7 @@ fn main() -> io::Result<()> {
|
|||
|
||||
Server::build()
|
||||
.bind("framed_hello", "127.0.0.1:8080", || {
|
||||
fn_service(|io: Io<_>| Ok(io.into_parts().0))
|
||||
fn_service(|io: Io<TcpStream>| Ok(io.into_parts().0))
|
||||
.and_then(IntoFramed::new(|| h1::Codec::new(ServiceConfig::default())))
|
||||
.and_then(TakeItem::new().map_err(|_| ()))
|
||||
.and_then(|(_req, _framed): (_, Framed<_, _>)| {
|
||||
|
|
|
@ -33,12 +33,12 @@ ssl = ["openssl", "actix-http/ssl", "actix-server/ssl"]
|
|||
|
||||
[dependencies]
|
||||
actix-codec = "0.1.1"
|
||||
actix-rt = "0.2.0"
|
||||
actix-rt = "0.2.1"
|
||||
actix-http = { path=".." }
|
||||
actix-service = "0.3.3"
|
||||
actix-service = "0.3.4"
|
||||
#actix-server = "0.3.0"
|
||||
actix-server = { git="https://github.com/actix/actix-net.git" }
|
||||
actix-utils = "0.3.2"
|
||||
actix-utils = "0.3.4"
|
||||
|
||||
base64 = "0.10"
|
||||
bytes = "0.4"
|
||||
|
|
|
@ -2,6 +2,7 @@ use std::io::{Read, Write};
|
|||
use std::time::Duration;
|
||||
use std::{net, thread};
|
||||
|
||||
use actix_codec::{AsyncRead, AsyncWrite};
|
||||
use actix_http_test::TestServer;
|
||||
use actix_server_config::ServerConfig;
|
||||
use actix_service::{fn_cfg_factory, NewService};
|
||||
|
@ -50,7 +51,8 @@ fn test_h1_2() {
|
|||
}
|
||||
|
||||
#[cfg(feature = "ssl")]
|
||||
fn ssl_acceptor<T>() -> std::io::Result<actix_server::ssl::OpensslAcceptor<T, ()>> {
|
||||
fn ssl_acceptor<T: AsyncRead + AsyncWrite>(
|
||||
) -> std::io::Result<actix_server::ssl::OpensslAcceptor<T, ()>> {
|
||||
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
|
||||
// load ssl keys
|
||||
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
|
||||
|
|
|
@ -9,6 +9,7 @@ use actix_utils::stream::TakeItem;
|
|||
use bytes::{Bytes, BytesMut};
|
||||
use futures::future::{ok, Either};
|
||||
use futures::{Future, Sink, Stream};
|
||||
use tokio_tcp::TcpStream;
|
||||
|
||||
use actix_http::{h1, ws, ResponseError, SendResponse, ServiceConfig};
|
||||
|
||||
|
@ -36,7 +37,7 @@ fn ws_service(req: ws::Frame) -> impl Future<Item = ws::Message, Error = io::Err
|
|||
#[test]
|
||||
fn test_simple() {
|
||||
let mut srv = TestServer::new(|| {
|
||||
fn_service(|io: Io<_>| Ok(io.into_parts().0))
|
||||
fn_service(|io: Io<TcpStream>| Ok(io.into_parts().0))
|
||||
.and_then(IntoFramed::new(|| h1::Codec::new(ServiceConfig::default())))
|
||||
.and_then(TakeItem::new().map_err(|_| ()))
|
||||
.and_then(|(req, framed): (_, Framed<_, _>)| {
|
||||
|
|
Loading…
Reference in a new issue