Skip to content

Commit 9df198f

Browse files
committed
Include connect info with app
1 parent 34a6e15 commit 9df198f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! runtime.block_on(async_block);
3636
//! }
3737
38-
use axum::{body::HttpBody, BoxError};
38+
use axum::{body::HttpBody, BoxError, ServiceExt};
3939
use bytes::Bytes;
4040
use http::{
4141
header::{HeaderName, HeaderValue},
@@ -44,7 +44,6 @@ use http::{
4444
use hyper::{Body, Server};
4545
use std::convert::TryFrom;
4646
use std::net::{SocketAddr, TcpListener};
47-
use tower::make::Shared;
4847
use tower_service::Service;
4948

5049
pub struct TestClient {
@@ -68,7 +67,7 @@ impl TestClient {
6867
println!("Listening on {}", addr);
6968

7069
tokio::spawn(async move {
71-
let server = Server::from_tcp(listener).unwrap().serve(Shared::new(svc));
70+
let server = Server::from_tcp(listener).unwrap().serve(svc.into_make_service_with_connect_info::<SocketAddr>());
7271
server.await.expect("server error");
7372
});
7473

0 commit comments

Comments
 (0)