2016-02-28 09:39:55 +01:00
## Client Blacklisting/Whitelisting Middlewares
This package provides the announce middlewares `client_whitelist` and `client_blacklist` for blacklisting or whitelisting clients for announces.
### `client_blacklist`
2016-04-04 15:07:35 +02:00
The `client_blacklist` middleware uses all clientIDs stored in the `StringStore` to blacklist, i.e. block announces.
2016-02-28 09:39:55 +01:00
2016-04-04 15:07:35 +02:00
The clientID part of the peerID of an announce is matched against the `StringStore` , if it's contained within the `StringStore` , the announce is aborted.
2016-02-28 09:39:55 +01:00
### `client_whitelist`
2016-04-04 15:07:35 +02:00
The `client_whitelist` middleware uses all clientIDs stored in the `StringStore` to whitelist, i.e. allow announces.
2016-02-28 09:39:55 +01:00
2016-04-04 15:07:35 +02:00
The clientID part of the peerID of an announce is matched against the `StringStore` , if it's _not_ contained within the `StringStore` , the announce is aborted.
2016-02-28 09:39:55 +01:00
### Important things to notice
Both middlewares operate on announce requests only.
2016-04-04 15:07:35 +02:00
Both middlewares use the same `StringStore` .
2016-02-28 09:39:55 +01:00
It is therefore not advised to have both the `client_blacklist` and the `client_whitelist` middleware running.
2016-04-04 15:07:35 +02:00
(If you add clientID to the `StringStore` , it will be used for blacklisting and whitelisting.
2016-02-28 09:39:55 +01:00
If your store contains no clientIDs, no announces will be blocked by the blacklist, but all announces will be blocked by the whitelist.
If your store contains all clientIDs, no announces will be blocked by the whitelist, but all announces will be blocked by the blacklist.)