Implement proxy header injection, hop-by-hop removal, and request forwarding
- Add ProxyError enum with IntoResponse for error handling (400, 404, 502, 504) - Implement proxy header injection: X-Real-IP, X-Forwarded-For (replaced, not appended), X-Forwarded-Proto - Implement hop-by-hop header removal for both request and response headers - Implement request forwarding via shared hyper::Client with HTTP and HTTPS support - Add ProxyState with http_client and https_client instances shared via axum State - Add per-site timeout overrides using tokio::time::timeout - Add HTTPS upstream support with system native TLS root certificates - No Server or Via headers added to responses - Host header preserved as-is - Add unit tests for header injection, hop-by-hop removal, and URI building - Add integration tests for proxy forwarding, hop-by-hop removal, and 502 on unreachable upstream
This commit is contained in:
@@ -3,3 +3,4 @@ pub mod handler;
|
||||
pub mod headers;
|
||||
|
||||
pub use crate::config::dynamic_config::normalize_host;
|
||||
pub use handler::{create_http_client, create_https_client, proxy_router, ProxyState};
|
||||
|
||||
Reference in New Issue
Block a user