fmt: fix proxy.rs formatting for CI rustfmt
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
src/proxy.rs
19
src/proxy.rs
@@ -50,7 +50,12 @@ pub async fn start_proxy(ctx: Arc<ServerCtx>, port: u16, bind_addr: Ipv4Addr) {
|
|||||||
axum::serve(listener, app).await.unwrap();
|
axum::serve(listener, app).await.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn start_proxy_tls(ctx: Arc<ServerCtx>, port: u16, bind_addr: Ipv4Addr, tls_config: Arc<ServerConfig>) {
|
pub async fn start_proxy_tls(
|
||||||
|
ctx: Arc<ServerCtx>,
|
||||||
|
port: u16,
|
||||||
|
bind_addr: Ipv4Addr,
|
||||||
|
tls_config: Arc<ServerConfig>,
|
||||||
|
) {
|
||||||
let addr: SocketAddr = (bind_addr, port).into();
|
let addr: SocketAddr = (bind_addr, port).into();
|
||||||
let listener = match tokio::net::TcpListener::bind(addr).await {
|
let listener = match tokio::net::TcpListener::bind(addr).await {
|
||||||
Ok(l) => l,
|
Ok(l) => l,
|
||||||
@@ -271,9 +276,15 @@ pre .str {{ color: #d48a5a }}
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let query_string = req.uri().query().map(|q| format!("?{}", q)).unwrap_or_default();
|
let query_string = req
|
||||||
let target_uri: hyper::Uri =
|
.uri()
|
||||||
format!("http://{}:{}{}{}", target_host, target_port, rewritten_path, query_string)
|
.query()
|
||||||
|
.map(|q| format!("?{}", q))
|
||||||
|
.unwrap_or_default();
|
||||||
|
let target_uri: hyper::Uri = format!(
|
||||||
|
"http://{}:{}{}{}",
|
||||||
|
target_host, target_port, rewritten_path, query_string
|
||||||
|
)
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user