Client Options
Options passed to theWebTorrent constructor:
Connection Settings
Maximum number of connections per torrent
If
true, establish outgoing connections while seeding. If false, only respond to incoming connections when seeding.Identity Settings
Wire protocol peer ID (default: randomly generated). Must be 20 bytes.
DHT protocol node ID (default: randomly generated). Must be 20 bytes.
Discovery Settings
Enable tracker support. Can be:
true- Enable with default optionsfalse- Disable tracker supportobject- Enable with custom options (see bittorrent-tracker docs)
announce- Array of tracker URLs to add to all torrentswrtc- Custom WebRTC implementation
Enable DHT support. Can be:
true- Enable with default optionsfalse- Disable DHTobject- Enable with custom options (see bittorrent-dht docs)
Enable BEP14 local service discovery
Enable BEP11 Peer Exchange
Enable BEP19 web seeds
Network Settings
Enable BEP29 uTorrent transport protocol (Node.js only)
Enable NAT port mapping via UPnP (Node.js only). Can be:
true- Use temporary mapping'permanent'- Use permanent TTL if router only supports permanent leasesfalse- Disable UPnP
Enable NAT port mapping via NAT-PMP (Node.js only). If both
natUpnp and natPmp are true, PMP is attempted first, then falls back to UPnP.Port for incoming torrent connections (Node.js only).
0 = random port.Port for DHT (Node.js only).
0 = random port.Bandwidth Settings
Maximum download speed in bytes/sec for all torrents. Can be:
> 0- Set throttle at that speed0- Block all downloads-1- Disable throttling (use full bandwidth)
Maximum upload speed in bytes/sec for all torrents. Can be:
> 0- Set throttle at that speed0- Block all uploads-1- Disable throttling (use full bandwidth)
Security Settings
List of IP addresses to block. Can be:
- Array of IP ranges
- URL to a blocklist file
Enable secure peer connections (experimental)
Torrent Options
Options passed toclient.add() or client.seed():
Discovery Options
Additional tracker URLs to use (added to those in .torrent or magnet URI)
Custom callback to send extra parameters to trackers
Array of web seed URLs (BEP19)
Maximum number of simultaneous connections per web seed
If
true, client will not share the hash with DHT or PEX. Default is the privacy setting from the torrent.Storage Options
Folder to download files to
(Node.js only) If
true, store files in an infoHash subfolder to prevent name collisions(Browser only) Custom directory handle for File System Access API. Retains torrent folder structure.
Custom chunk store constructor. Must follow abstract-chunk-store API.
Pre-loaded chunk store instance
Custom options passed to the store constructor
Number of pieces to cache in memory. Set to
0 to disable caching.If
true, delete files from disk when torrent is destroyedDownload Options
Piece selection strategy
If
true, skip verification of existing pieces and assume they’re correctPre-loaded bitfield indicating which pieces are already downloaded
If
true, create the torrent in a paused stateIf
true, create the torrent with no pieces selectedUpload Options
Maximum number of upload slots. Set to
false or 0 to disable uploading.If
true, automatically choke seeders when seedingAdvanced Options
Time in seconds to wait between
noPeers event checksArray of UNIX timestamps indicating last modification time for each file. Used to skip verification if files haven’t changed.
Seed Options
Options passed toclient.seed() include all torrent options plus create-torrent options:
Torrent Creation
Name of the torrent. If not provided, determined automatically from file names.
Comment to include in the torrent
Creator/editor of the torrent
Creation date (default: now)
Piece length in bytes (default: auto-calculated)
If
true, don’t announce on DHT or allow PEXAdditional info dict fields