feat: change default listen to IPv4 and add panic recovery (#36)

This commit is contained in:
weisd
2025-07-03 13:51:38 +08:00
committed by GitHub
parent d6653f1258
commit 6983a3ffce
4 changed files with 9 additions and 4 deletions
+1
View File
@@ -94,6 +94,7 @@ tower-http = { workspace = true, features = [
"compression-deflate",
"compression-gzip",
"cors",
"catch-panic",
] }
urlencoding = { workspace = true }
uuid = { workspace = true }
+2
View File
@@ -77,6 +77,7 @@ use tokio::net::TcpListener;
use tokio::signal::unix::{SignalKind, signal};
use tokio_rustls::TlsAcceptor;
use tonic::{Request, Status, metadata::MetadataValue};
use tower_http::catch_panic::CatchPanicLayer;
use tower_http::cors::CorsLayer;
use tower_http::trace::TraceLayer;
use tracing::{Span, debug, error, info, instrument, warn};
@@ -336,6 +337,7 @@ async fn run(opt: config::Opt) -> Result<()> {
let hybrid_service = TowerToHyperService::new(
tower::ServiceBuilder::new()
.layer(CatchPanicLayer::new())
.layer(
TraceLayer::new_for_http()
.make_span_with(|request: &HttpRequest<_>| {