pub struct FreeListFetcher { /* private fields */ }Expand description
Fetches plain-text host:port proxy lists from one or more public URLs.
Each source is fetched concurrently. Lines that do not parse as valid
host:port entries are silently skipped. An empty or unreachable source
logs a warning but does not fail the entire fetch — at least one source
must return results for the call to succeed.
§Example
use stygian_proxy::fetcher::{FreeListFetcher, FreeListSource, ProxyFetcher};
let fetcher = FreeListFetcher::new(vec![FreeListSource::TheSpeedXHttp]);
let proxies = fetcher.fetch().await?;
println!("Got {} proxies", proxies.len());Implementations§
Source§impl FreeListFetcher
impl FreeListFetcher
Sourcepub fn new(sources: Vec<FreeListSource>) -> Self
pub fn new(sources: Vec<FreeListSource>) -> Self
Create a fetcher for the given sources with default HTTP client settings (10 s timeout, TLS enabled).
§Example
use stygian_proxy::fetcher::{FreeListFetcher, FreeListSource};
let _f = FreeListFetcher::new(vec![FreeListSource::TheSpeedXHttp]);Attach extra tags to every proxy produced by this fetcher.
§Example
use stygian_proxy::fetcher::{FreeListFetcher, FreeListSource};
let _f = FreeListFetcher::new(vec![FreeListSource::TheSpeedXHttp])
.with_tags(vec!["dev".into(), "http".into()]);Trait Implementations§
Source§impl ProxyFetcher for FreeListFetcher
impl ProxyFetcher for FreeListFetcher
Auto Trait Implementations§
impl Freeze for FreeListFetcher
impl !RefUnwindSafe for FreeListFetcher
impl Send for FreeListFetcher
impl Sync for FreeListFetcher
impl Unpin for FreeListFetcher
impl UnsafeUnpin for FreeListFetcher
impl !UnwindSafe for FreeListFetcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more