Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34dc0cb9b6 | |||
| c83c43194b |
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-23 - 26.2.1 - fix(rustproxy-http)
|
||||||
|
include the upstream request URL when caching H3 Alt-Svc discoveries
|
||||||
|
|
||||||
|
- Tracks the request path that triggered Alt-Svc discovery in connection activity state
|
||||||
|
- Adds request URL context to Alt-Svc debug logging and protocol cache insertion reasons for better traceability
|
||||||
|
|
||||||
## 2026-03-23 - 26.2.0 - feat(protocol-cache)
|
## 2026-03-23 - 26.2.0 - feat(protocol-cache)
|
||||||
add sliding TTL re-probing and eviction for backend protocol detection
|
add sliding TTL re-probing and eviction for backend protocol detection
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartproxy",
|
"name": "@push.rocks/smartproxy",
|
||||||
"version": "26.2.0",
|
"version": "26.2.1",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.",
|
"description": "A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ pub struct ConnActivity {
|
|||||||
/// checks the backend's original response headers for Alt-Svc before our
|
/// checks the backend's original response headers for Alt-Svc before our
|
||||||
/// ResponseFilter injects its own. None when not in auto-detect mode or after H3 failure.
|
/// ResponseFilter injects its own. None when not in auto-detect mode or after H3 failure.
|
||||||
alt_svc_cache_key: Option<crate::protocol_cache::ProtocolCacheKey>,
|
alt_svc_cache_key: Option<crate::protocol_cache::ProtocolCacheKey>,
|
||||||
|
/// The upstream request path that triggered Alt-Svc discovery. Logged for traceability.
|
||||||
|
alt_svc_request_url: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ConnActivity {
|
impl ConnActivity {
|
||||||
@@ -58,6 +60,7 @@ impl ConnActivity {
|
|||||||
start: std::time::Instant::now(),
|
start: std::time::Instant::now(),
|
||||||
active_requests: None,
|
active_requests: None,
|
||||||
alt_svc_cache_key: None,
|
alt_svc_cache_key: None,
|
||||||
|
alt_svc_request_url: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -371,7 +374,7 @@ impl HttpProxyService {
|
|||||||
let cn = cancel_inner.clone();
|
let cn = cancel_inner.clone();
|
||||||
let la = Arc::clone(&la_inner);
|
let la = Arc::clone(&la_inner);
|
||||||
let st = start;
|
let st = start;
|
||||||
let ca = ConnActivity { last_activity: Arc::clone(&la_inner), start, active_requests: Some(Arc::clone(&ar_inner)), alt_svc_cache_key: None };
|
let ca = ConnActivity { last_activity: Arc::clone(&la_inner), start, active_requests: Some(Arc::clone(&ar_inner)), alt_svc_cache_key: None, alt_svc_request_url: None };
|
||||||
async move {
|
async move {
|
||||||
let req = req.map(|body| BoxBody::new(body));
|
let req = req.map(|body| BoxBody::new(body));
|
||||||
let result = svc.handle_request(req, peer, port, cn, ca).await;
|
let result = svc.handle_request(req, peer, port, cn, ca).await;
|
||||||
@@ -775,6 +778,7 @@ impl HttpProxyService {
|
|||||||
// the backend's original Alt-Svc header before ResponseFilter injects our own.
|
// the backend's original Alt-Svc header before ResponseFilter injects our own.
|
||||||
if is_auto_detect_mode {
|
if is_auto_detect_mode {
|
||||||
conn_activity.alt_svc_cache_key = Some(protocol_cache_key.clone());
|
conn_activity.alt_svc_cache_key = Some(protocol_cache_key.clone());
|
||||||
|
conn_activity.alt_svc_request_url = Some(upstream_path.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- H3 path: try QUIC connection before TCP ---
|
// --- H3 path: try QUIC connection before TCP ---
|
||||||
@@ -1979,8 +1983,10 @@ impl HttpProxyService {
|
|||||||
if let Some(ref cache_key) = conn_activity.alt_svc_cache_key {
|
if let Some(ref cache_key) = conn_activity.alt_svc_cache_key {
|
||||||
if let Some(alt_svc) = resp_parts.headers.get("alt-svc").and_then(|v| v.to_str().ok()) {
|
if let Some(alt_svc) = resp_parts.headers.get("alt-svc").and_then(|v| v.to_str().ok()) {
|
||||||
if let Some(h3_port) = parse_alt_svc_h3_port(alt_svc) {
|
if let Some(h3_port) = parse_alt_svc_h3_port(alt_svc) {
|
||||||
debug!(h3_port, "Backend advertises H3 via Alt-Svc");
|
let url = conn_activity.alt_svc_request_url.as_deref().unwrap_or("-");
|
||||||
self.protocol_cache.insert_h3(cache_key.clone(), h3_port, "Alt-Svc response header");
|
debug!(h3_port, url, "Backend advertises H3 via Alt-Svc");
|
||||||
|
let reason = format!("Alt-Svc response header ({})", url);
|
||||||
|
self.protocol_cache.insert_h3(cache_key.clone(), h3_port, &reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartproxy',
|
name: '@push.rocks/smartproxy',
|
||||||
version: '26.2.0',
|
version: '26.2.1',
|
||||||
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
|
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user