HttpTracker
class HttpTracker(client: HttpClient, maxResponseBytes: Int = DEFAULT_MAX_RESPONSE_BYTES, network: NetworkRuntime? = null)
HTTP(S) tracker client, the network half of libtorrent's http_tracker_connection. All the protocol logic (building the announce URL with percent-encoded binary info-hash/peer-id, parsing the bencoded response incl. BEP-23 compact peers) lives in the pure, tested HttpTrackerCodec; this class is just the ktor-client GET around it.
The client is injected so the platform engine (CIO on JVM/Android, Darwin on iOS) is chosen by the caller, and so it can be mocked in tests.
Constructors
Link copied to clipboard
constructor(client: HttpClient, maxResponseBytes: Int = DEFAULT_MAX_RESPONSE_BYTES, network: NetworkRuntime? = null)
Functions
Link copied to clipboard
Announce to announceUrl and parse the swarm response.
Link copied to clipboard
Scrape swarm stats for infoHashes from the tracker behind announceUrl.