Merge pull request #195 from ivulit/fix/mask-host-tls-emulation

Use mask_host for TLS emulation fetcher
This commit is contained in:
Alexey 2026-02-21 13:58:38 +03:00 committed by GitHub
commit 7bf6f3e071
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -461,10 +461,12 @@ match crate::transport::middle_proxy::fetch_proxy_secret(proxy_secret_path).awai
cache.load_from_disk().await; cache.load_from_disk().await;
let port = config.censorship.mask_port; let port = config.censorship.mask_port;
let mask_host = config.censorship.mask_host.clone()
.unwrap_or_else(|| config.censorship.tls_domain.clone());
// Initial synchronous fetch to warm cache before serving clients. // Initial synchronous fetch to warm cache before serving clients.
for domain in tls_domains.clone() { for domain in tls_domains.clone() {
match crate::tls_front::fetcher::fetch_real_tls( match crate::tls_front::fetcher::fetch_real_tls(
&domain, &mask_host,
port, port,
&domain, &domain,
Duration::from_secs(5), Duration::from_secs(5),
@ -488,7 +490,7 @@ match crate::transport::middle_proxy::fetch_proxy_secret(proxy_secret_path).awai
tokio::time::sleep(Duration::from_secs(base_secs + jitter_secs)).await; tokio::time::sleep(Duration::from_secs(base_secs + jitter_secs)).await;
for domain in &domains { for domain in &domains {
match crate::tls_front::fetcher::fetch_real_tls( match crate::tls_front::fetcher::fetch_real_tls(
domain, &mask_host,
port, port,
domain, domain,
Duration::from_secs(5), Duration::from_secs(5),