anacrolix / torrent

Full-featured BitTorrent client package and utilities
Mozilla Public License 2.0
5.51k stars 622 forks source link

how to ban client ? #927

Closed MrGlp closed 5 months ago

MrGlp commented 5 months ago

hello, dear author~~ thank you very much for your contribution to the ecosystem with your code. Not just the torrent library, but also bargle and others are really user-friendly.

I've encountered a problem this time. You might be aware of the recent incidents with dt clients and other vampire clients like xunlei. How can I ban these clients through code? Specifically, their identifiers like xl, dt, etc., which have caused me a lot of trouble.

anacrolix commented 5 months ago

Ideally I think something should be exposed in https://pkg.go.dev/github.com/anacrolix/torrent#Callbacks to allow you to intercept after the handshake and decide if you want to proceed with the peer connection.

anacrolix commented 5 months ago

There is an IPBlocklist in https://pkg.go.dev/github.com/anacrolix/torrent#ClientConfig. Per my recommendations elsewhere, this is also a good place to start.