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.
§Errors
This function is infallible but returns Result for API consistency.
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.
§Errors
Returns an error if the HTTP request fails or the response is malformed.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more