4 "github.com/anacrolix/dht"
5 "golang.org/x/time/rate"
7 "github.com/anacrolix/torrent/iplist"
8 "github.com/anacrolix/torrent/storage"
11 // Override Client defaults.
13 // Store torrent file data in this directory unless TorrentDataOpener is
15 DataDir string `long:"data-dir" description:"directory to store downloaded torrent data"`
16 // The address to listen for new uTP and TCP bittorrent protocol
17 // connections. DHT shares a UDP socket with uTP unless configured
19 ListenAddr string `long:"listen-addr" value-name:"HOST:PORT"`
20 // Don't announce to trackers. This only leaves DHT to discover peers.
21 DisableTrackers bool `long:"disable-trackers"`
22 DisablePEX bool `long:"disable-pex"`
23 // Don't create a DHT.
24 NoDHT bool `long:"disable-dht"`
25 // Overrides the default DHT configuration.
26 DHTConfig dht.ServerConfig
28 // Never send chunks to peers.
29 NoUpload bool `long:"no-upload"`
30 // Disable uploading even when it isn't fair.
31 DisableAggressiveUpload bool `long:"disable-aggressive-upload"`
32 // Upload even after there's nothing in it for us. By default uploading is
33 // not altruistic, we'll upload slightly more than we download from each
35 Seed bool `long:"seed"`
36 // Events are data bytes sent in pieces. The burst must be large enough to
37 // fit a whole chunk, which is usually 16 KiB.
38 UploadRateLimiter *rate.Limiter
39 // The events are bytes read from connections. The burst must be bigger
40 // than the largest Read performed on a Conn minus one. This is likely to
41 // be the larger of the main read loop buffer (~4096), and the requested
42 // chunk size (~16KiB).
43 DownloadRateLimiter *rate.Limiter
45 // User-provided Client peer ID. If not present, one is generated automatically.
47 // For the bittorrent protocol.
49 // For the bittorrent protocol.
50 DisableTCP bool `long:"disable-tcp"`
51 // Called to instantiate storage for each added torrent. Builtin backends
52 // are in the storage package. If not set, the "file" implementation is
54 DefaultStorage storage.ClientImpl
58 IPBlocklist iplist.Ranger
59 DisableIPv6 bool `long:"disable-ipv6"`
60 // Perform logging and any other behaviour that will help debug.
61 Debug bool `help:"enable debugging"`
64 type EncryptionPolicy struct {
65 DisableEncryption bool
66 ForceEncryption bool // Don't allow unobfuscated connections.
67 PreferNoEncryption bool