Upstream client to always use HTTP/2 and HTTPS
This commit is contained in:
parent
97ea5eb448
commit
2501bb8da0
1 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
use actix_web::error::ErrorNotFound;
|
use actix_web::error::ErrorNotFound;
|
||||||
use actix_web::http::header::{
|
use actix_web::http::header::{
|
||||||
|
@ -31,7 +32,14 @@ use crate::state::RwLockServerState;
|
||||||
|
|
||||||
pub const BASE64_CONFIG: base64::Config = base64::Config::new(base64::CharacterSet::UrlSafe, false);
|
pub const BASE64_CONFIG: base64::Config = base64::Config::new(base64::CharacterSet::UrlSafe, false);
|
||||||
|
|
||||||
static HTTP_CLIENT: Lazy<Client> = Lazy::new(Client::new);
|
static HTTP_CLIENT: Lazy<Client> = Lazy::new(|| {
|
||||||
|
Client::builder()
|
||||||
|
.pool_idle_timeout(Duration::from_secs(180))
|
||||||
|
.https_only(true)
|
||||||
|
.http2_prior_knowledge()
|
||||||
|
.build()
|
||||||
|
.expect("Client initialization to work")
|
||||||
|
});
|
||||||
|
|
||||||
const SERVER_ID_STRING: &str = concat!(
|
const SERVER_ID_STRING: &str = concat!(
|
||||||
env!("CARGO_CRATE_NAME"),
|
env!("CARGO_CRATE_NAME"),
|
||||||
|
|
Loading…
Reference in a new issue