mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
perf(app-proxy): serve precompressed assets and pass through (#2165)
This commit is contained in:
1 parent
72ffa3bd9a
commit
a2d7f5e8cc
5 files changed
+553
-16
No files matched your search
@@ -5,6 +5,7 @@ use crate::discovery_cache::DiscoveryCache;
|
||||
use crate::invite_meta::InviteMetaResolver;
|
||||
use fluxer_common::geoip::GeoipResolver;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
@@ -15,3 +16,14 @@ pub struct AppState {
|
||||
pub invite_meta: Option<Arc<InviteMetaResolver>>,
|
||||
pub index_html: Option<Arc<str>>,
|
||||
}
|
||||
|
||||
pub fn build_http_client() -> reqwest::Result<reqwest::Client> {
|
||||
reqwest::Client::builder()
|
||||
.connect_timeout(Duration::from_secs(5))
|
||||
.timeout(Duration::from_secs(30))
|
||||
.redirect(reqwest::redirect::Policy::limited(2))
|
||||
.no_gzip()
|
||||
.no_brotli()
|
||||
.no_deflate()
|
||||
.build()
|
||||
}
|
||||
Reference in new issue
Block a user