anacrolix / torrent

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

how to ban client ? #927

Closed MrGlp closed 7 months ago

MrGlp commented 7 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 7 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 7 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.