mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 20:26:28 -06:00
refactor: consolidate HTTP client for TCP/Unix socket handling
Extract reqwest client creation into dedicated HttpClient abstraction that handles both TCP and Unix socket connections transparently. Simplifies proxy logic by removing duplicate URL construction and client selection throughout the codebase.
This commit is contained in:
+2
-4
@@ -1,13 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{auth::SessionManager, health::HealthChecker, tarpit::TarpitState};
|
||||
use crate::{auth::SessionManager, health::HealthChecker, http::HttpClient, tarpit::TarpitState};
|
||||
|
||||
/// Application state shared across all handlers
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
pub downstream_url: String,
|
||||
pub http_client: reqwest::Client,
|
||||
pub unix_client: Option<reqwest::Client>,
|
||||
pub client: HttpClient,
|
||||
pub health_checker: Arc<HealthChecker>,
|
||||
pub tarpit_state: Arc<TarpitState>,
|
||||
pub pool: sqlx::PgPool,
|
||||
|
||||
Reference in New Issue
Block a user