dauphin
v0.1.2
Published
A lightweight and clean BitTorrent client
Downloads
25
Maintainers
Readme
Dauphin 🐬
A lightweight and clean BitTorrent client written in Node.js.
Features
- Pure JavaScript implementation (no external torrent libraries)
- HTTP and UDP tracker support
- Peer wire protocol implementation
- Piece verification with SHA-1 hashing
- Clean command-line interface
- Progress tracking
Installation
Global Installation (Recommended)
Install globally to use the dauphin command anywhere:
npm install -g dauphinLocal Installation
Install in your project:
npm install dauphinFrom Source
Clone and install:
git clone https://github.com/yourusername/dauphin.git
cd dauphin
npm install
npm linkUsage
Basic Usage
dauphin <torrent-file>With Options
# Specify output directory
dauphin file.torrent -o ~/Downloads
# Enable debug mode
dauphin file.torrent --debug
# Show help
dauphin --help
# Show version
dauphin --versionOptions
-o, --output <dir>- Output directory for downloads (default:./downloads)-h, --help- Show help message-v, --version- Show version number--debug- Enable debug mode with detailed error output
Examples
Download Ubuntu ISO:
dauphin ubuntu.torrentDownload to specific folder:
dauphin movie.torrent --output /media/downloadsArchitecture
- src/index.js - CLI entry point
- src/torrent-parser.js - Parses .torrent files (bencode decoding)
- src/tracker.js - Communicates with trackers (HTTP/UDP)
- src/peer.js - Handles peer connections and wire protocol
- src/pieces.js - Manages piece selection and verification
- src/downloader.js - Coordinates the download process
- src/utils.js - Utility functions
Protocol Support
- BitTorrent Protocol (BEP 3)
- HTTP Tracker Protocol
- UDP Tracker Protocol (BEP 15)
Development
Running Tests
npm testRunning in Watch Mode
npm run test:watchRunning from Source
npm start -- file.torrent -o ./downloadsRequirements
- Node.js >= 18.0.0
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
