Extend BitTorrent sniffer - #6668
Conversation
|
torrent sniffer 出于兼容性而保留 实际意义不大 它可以被非常轻松的绕过 所以不打算扩展 |
@Fangliding with the help of a webhook, rules can warn/punish users who use torrents (this approach is used in the Torrent Blocker of the Remnawave Panel). And I know that it's impossible to completely block torrents. When I checked packets from BitComet, I didn't notice a single uTP packet or BitTorrent Handshake (with default settings). This PR just extends detection. And it contains very little code |
|
@RPRX why |
|
@RPRX What do you think about this? Do you share Fangliding’s view? If users run BitTorrent, it could result in servers (whether VPS or dedicated) being suspended by the service provider due to copyright infringement risks. An example of such a case: This PR just adds detection for three protocols, and detecting them is not difficult! Each protocol has distinct byte patterns, which make them easy to detect. So I don’t see a problem with this... Also, as I said earlier, with the help of a webhook, rules can warn/punish users who use torrents, and this approach is used by Remnawave Panel |

Currently, the BitTorrent sniffer can only detect the BitTorrent Handshake and uTP (uTP is currently broken, but PR #6667 fixes it).
I decided to add detection for several protocols from the BitTorrent family:
Also
string(b[1:20])inSniffBittorrent()causes an allocation. It was replaced withbytes.HasPrefix.I tested this using Wireshark and BitComet/qBittorrent