Skip to content

add ClientConfig.AnonymousMode#1026

Open
milahu wants to merge 5 commits intoanacrolix:masterfrom
milahu:add-ClientConfig-AnonymousMode
Open

add ClientConfig.AnonymousMode#1026
milahu wants to merge 5 commits intoanacrolix:masterfrom
milahu:add-ClientConfig-AnonymousMode

Conversation

@milahu
Copy link
Copy Markdown
Contributor

@milahu milahu commented Oct 19, 2025

No description provided.

@milahu milahu marked this pull request as ready for review October 19, 2025 19:11
@anacrolix
Copy link
Copy Markdown
Owner

This is a great idea. Could make SetAnonymousMode as a method on ClientConfig, if the Client doesn't need to know about it?

Can you link to some reference/example from libtorrent about the decisions involved in how to operate in anonymous mode?

@milahu
Copy link
Copy Markdown
Contributor Author

milahu commented Nov 12, 2025

decisions involved in how to operate in anonymous mode

the main idea is to send as little information as possible
and if we have to send some info then it should be as generic as possible

so currently, the http user-agent is curl/7.81.0
and the bittorrent user-agent is libtorrent 2.0.11

search "anonymous mode" in libtorrent

probably we should add more comments to document this

we also should mention limitations of this approach
mostly the random peer ID suffix is constant per session
which allows fingerprinting and tracking of peers

possible workaround:
use a separate session (with separate port and peer ID) for each torrent

related concepts: force encryption, VPN, I2P

I2P can provide much stronger anonymity than this "anonymous mode"

(sorry i have no time for this now, just sharing my thoughts)

anacrolix and others added 4 commits February 24, 2026 21:49
_pendingPieces.Add(0) was called without holding the client lock and
without updating the piece request order, causing two issues:
1. Data race with timer goroutines accessing the roaring bitmap
2. Panic in checkPendingPiecesMatchesRequestOrder due to _pendingPieces
   and requestOrder being out of sync

Replace the direct bitmap manipulation with updatePiecePriority(0, ...)
which properly updates both _pendingPieces and the piece request order
while holding the client lock.

Co-authored-by: info@weblogix.biz <admin@10gbps.weblogix.it>
Co-authored-by: Matt Joiner <anacrolix@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants