fix(rustproxy-http): improve async static file serving, websocket handshake buffering, and shared metric metadata handling

This commit is contained in:
2026-03-17 16:47:57 +00:00
parent 5dccbbc9d1
commit c9d0fccb2d
4 changed files with 153 additions and 119 deletions

View File

@@ -25,8 +25,8 @@ const BYTE_FLUSH_THRESHOLD: u64 = 65_536;
pub struct CountingBody<B> {
inner: Pin<Box<B>>,
metrics: Arc<MetricsCollector>,
route_id: Option<String>,
source_ip: Option<String>,
route_id: Option<Arc<str>>,
source_ip: Option<Arc<str>>,
/// Whether we count bytes as "in" (request body) or "out" (response body).
direction: Direction,
/// Accumulated bytes not yet flushed to the metrics collector.
@@ -56,8 +56,8 @@ impl<B> CountingBody<B> {
pub fn new(
inner: B,
metrics: Arc<MetricsCollector>,
route_id: Option<String>,
source_ip: Option<String>,
route_id: Option<Arc<str>>,
source_ip: Option<Arc<str>>,
direction: Direction,
) -> Self {
Self {