mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
Remove impl Connected<&AddrStream> for SocketAddr (#1954)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
use openssl::ssl::{Ssl, SslAcceptor, SslFiletype, SslMethod};
|
||||
use tokio_openssl::SslStream;
|
||||
|
||||
use axum::{body::Body, extract::ConnectInfo, http::Request, routing::get, Router};
|
||||
use axum::{body::Body, http::Request, routing::get, Router};
|
||||
use futures_util::future::poll_fn;
|
||||
use hyper::server::{
|
||||
accept::Accept,
|
||||
conn::{AddrIncoming, Http},
|
||||
};
|
||||
use std::{net::SocketAddr, path::PathBuf, pin::Pin, sync::Arc};
|
||||
use std::{path::PathBuf, pin::Pin, sync::Arc};
|
||||
use tokio::net::TcpListener;
|
||||
use tower::MakeService;
|
||||
|
||||
@@ -52,9 +52,7 @@ async fn main() {
|
||||
|
||||
let protocol = Arc::new(Http::new());
|
||||
|
||||
let mut app = Router::new()
|
||||
.route("/", get(handler))
|
||||
.into_make_service_with_connect_info::<SocketAddr>();
|
||||
let mut app = Router::new().route("/", get(handler)).into_make_service();
|
||||
|
||||
tracing::info!("listening on https://localhost:3000");
|
||||
|
||||
@@ -83,6 +81,6 @@ async fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
async fn handler(ConnectInfo(addr): ConnectInfo<SocketAddr>) -> String {
|
||||
addr.to_string()
|
||||
async fn handler() -> &'static str {
|
||||
"Hello, World!"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user