MCPcopy Create free account
hub / github.com/apache/skywalking-php / setup_http_proxy_server

Function setup_http_proxy_server

tests/common/mod.rs:142–164  ·  view source on GitHub ↗
(http_addr: &str, fpm_addr: &'static str)

Source from the content-addressed store, hash-verified

140
141#[instrument]
142async fn setup_http_proxy_server(http_addr: &str, fpm_addr: &'static str) {
143 let http_addr = http_addr.parse().unwrap();
144 let fpm_addr = fpm_addr.parse().unwrap();
145 let state = Arc::new(State {
146 http_addr,
147 fpm_addr,
148 });
149 info!(?state, "start http proxy server");
150
151 let app = Router::new()
152 .route("/{*path}", any(http_proxy_fpm_handler))
153 .layer(Extension(state.clone()));
154
155 let listener = tokio::net::TcpListener::bind(&state.http_addr)
156 .await
157 .unwrap();
158 axum::serve(
159 listener,
160 app.into_make_service_with_connect_info::<SocketAddr>(),
161 )
162 .await
163 .unwrap();
164}
165
166#[instrument(skip_all)]
167async fn http_proxy_fpm_handler(

Callers 1

setupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected