pub struct HttpTracker { /* private fields */ }Expand description
HTTP tracker client (BEP 3).
Implementations§
Source§impl HttpTracker
impl HttpTracker
Sourcepub fn with_anonymous() -> Self
pub fn with_anonymous() -> Self
Create an HTTP tracker client for anonymous mode.
Uses an empty user-agent string to avoid identifying the client software.
Sourcepub fn with_proxy(proxy_url: Option<&str>) -> Self
pub fn with_proxy(proxy_url: Option<&str>) -> Self
Create an HTTP tracker client with an optional proxy.
When proxy_url is provided (e.g. "socks5://host:port"), all
HTTP requests are routed through it.
Sourcepub fn with_security(
proxy_url: Option<&str>,
validate_tls: bool,
ssrf_mitigation: bool,
) -> Self
pub fn with_security( proxy_url: Option<&str>, validate_tls: bool, ssrf_mitigation: bool, ) -> Self
Create an HTTP tracker client with URL security features.
When ssrf_mitigation is enabled, a custom redirect policy blocks
redirects from global (public) URLs to private/loopback IP addresses.
When validate_tls is false, TLS certificate validation is disabled.
Sourcepub fn build_announce_url(
base_url: &str,
req: &AnnounceRequest,
) -> Result<String>
pub fn build_announce_url( base_url: &str, req: &AnnounceRequest, ) -> Result<String>
Build the announce URL with query parameters.
Sourcepub async fn announce(
&self,
base_url: &str,
req: &AnnounceRequest,
) -> Result<HttpAnnounceResponse>
pub async fn announce( &self, base_url: &str, req: &AnnounceRequest, ) -> Result<HttpAnnounceResponse>
Send an announce request to an HTTP tracker.
Source§impl HttpTracker
impl HttpTracker
Trait Implementations§
Source§impl Clone for HttpTracker
impl Clone for HttpTracker
Source§fn clone(&self) -> HttpTracker
fn clone(&self) -> HttpTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpTracker
impl !RefUnwindSafe for HttpTracker
impl Send for HttpTracker
impl Sync for HttpTracker
impl Unpin for HttpTracker
impl UnsafeUnpin for HttpTracker
impl !UnwindSafe for HttpTracker
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