0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-23 22:48:21 -05:00
This commit is contained in:
m00nwtchr 2024-10-04 08:28:44 +02:00
parent 808707c43b
commit d20c5c4dab
No known key found for this signature in database
GPG Key ID: 276CAB3DFFD6903D
3 changed files with 4 additions and 16 deletions

13
Cargo.lock generated
View File

@ -3266,7 +3266,6 @@ dependencies = [
"sync_wrapper",
"tokio 1.40.0",
"tokio-rustls",
"tokio-socks",
"tokio-util",
"tower-service",
"url 2.5.2",
@ -4097,18 +4096,6 @@ dependencies = [
"tokio 1.40.0",
]
[[package]]
name = "tokio-socks"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f"
dependencies = [
"either",
"futures-util",
"thiserror",
"tokio 1.38.0",
]
[[package]]
name = "tokio-sync"
version = "0.1.8"

View File

@ -174,7 +174,7 @@ opt-level = "z"
[features]
use-synonyms-search = ["thesaurus/static"]
default = ["memory-cache", "socks"]
default = ["memory-cache"]
dhat-heap = ["dep:dhat"]
memory-cache = ["dep:moka"]
redis-cache = ["dep:redis", "dep:base64"]

View File

@ -123,12 +123,13 @@ impl Config {
_ => parsed_cet,
};
let proxy_opt = globals.get::<_, Option<String>>("proxy")?;
let proxy_opt = globals.get::<_, Option<String>>("proxy")?;
let proxy = proxy_opt.and_then(|proxy_str| {
Proxy::all(proxy_str).ok().and_then(|_| {
log::error!("Invalid proxy url, defaulting to no proxy.");
None
})
});
Ok(Config {
port: globals.get::<_, u16>("port")?,