ut-extensions
Extensions for The Bittorent Protocol
- PEX (PEer eXchange) Protocol [BEP_0011]
- Extension Protocol [BEP_0010]
- DHT (Distrubuted Hash Table) Protocol [BEP_0005]
- Canonical Peer Priority [BEP_0040]
Install
npm install ut-extensions
Usage
UTmetadata
metaDataSize: number infoHash: string;
- metaDataSize - total size of the torrent data
- infoHash - info_hash of the torrent to be downloaded
;// create a metadata instanceconst metadata = 18716 "294150cb4beb7585d89d5faf447121fee5360d82";// Incoming metadata Buffer goes heremetadata;metadata;metadata;metadata;// Prepare metadata handshake buffer for incoming peerslet buf = metadata;
UTpex
;
- no inputs
;// Create a pex instanceconst pex = ;// Incoming pex Buffer goes herepex;pex;pex;pex;pex;// Add "add" peers to the listpex;pex;// Add "drop" peers to the listpex;pex;// Prepare a message to send outlet msg = ;// Add all optionspex;
ISC License (Open Source Initiative)
ISC License (ISC) Copyright 2017 Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") Copyright (c) 1995-2003 by Internet Software Consortium
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.