Documentation
¶
Overview ¶
Package clientapproval XXX: implementation is broken, client ID is NOT 6 static bytes refer: - https://wiki.theory.org/BitTorrentSpecification#peer_id - https://github.com/webtorrent/bittorrent-peerid/blob/master/lib/utils.js
Package clientapproval implements a Hook that fails an Announce based on a whitelist or blacklist of BitTorrent client IDs.
Index ¶
Constants ¶
const Name = "client approval"
Name is the name by which this middleware is registered with Conf.
Variables ¶
var ErrClientUnapproved = bittorrent.ClientError("client not allowed by mochi")
ErrClientUnapproved is the error returned when a client's PeerID is invalid.
Functions ¶
This section is empty.
Types ¶
type ClientID ¶
type ClientID [6]byte
ClientID represents the part of a PeerID that identifies a Peer's client software.
func NewClientID ¶
func NewClientID(pid bittorrent.PeerID) ClientID
NewClientID parses a ClientID from a PeerID.
type Config ¶
type Config struct { // Static list of client IDs. ClientIDList []string `cfg:"client_id_list"` // If Invert set to true, all client IDs stored in ClientIDList should be blacklisted. Invert bool }
Config represents all the values required by this middleware to validate peers based on their BitTorrent client ID.