clientapproval

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

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

View Source
const Name = "client approval"

Name is the name by which this middleware is registered with Conf.

Variables

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL