<h1 align="center">
<a href="http://atomashpolskiy.github.io/bt/">Bt</a>
<a href="https://twitter.com/intent/tweet?text=Bt%3A%20A%20Java%208%20BitTorrent%20library%20with%20DHT%2C%20magnet%20links%2C%20encryption%20and%20more&url=https://github.com/atomashpolskiy/bt&via=atomashpolskiy&hashtags=java,bittorrent,dht,library">
<img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter"
alt="Tweet">
</a>
</h1>
<p align="center"><strong>
<sup>
A full-featured BitTorrent implementation in Java 8
<br/><a href="http://bittorrent.org/beps/bep_0011.html">peer exchange</a> | <a href="http://bittorrent.org/beps/bep_0009.html">magnet links</a> | <a href="http://bittorrent.org/beps/bep_0005.html">DHT</a> | <a href="http://wiki.vuze.com/w/Message_Stream_Encryption">encryption</a> | <a href="http://bittorrent.org/beps/bep_0014.html">LSD</a> | <a href="http://bittorrent.org/beps/bep_0027.html">private trackers</a> | <a href="http://bittorrent.org/beps/bep_0010.html">extended protocol</a> | <a href="#partial-downloads">partial downloads</a> | <a href="https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol">port forwarding</a>
</sup>
</strong></p>
<p align="center">
<img src="https://atomashpolskiy.github.io/static/img/bt-source-code.png" alt="Bt Example">
</p>
<p align="center">
<img src="https://atomashpolskiy.github.io/static/img/bt-animated.gif" alt="Bt CLI">
</p>
<p align="center">
<a href="https://travis-ci.org/atomashpolskiy/bt">
<img src="https://img.shields.io/travis/atomashpolskiy/bt/master.svg?label=Linux%20build"
alt="Linux build">
</a>
<a href="https://ci.appveyor.com/project/atomashpolskiy/bt">
<img src="https://img.shields.io/appveyor/ci/atomashpolskiy/bt/master.svg?label=Windows%20build"
alt="Linux build">
</a>
<a href="https://maven-badges.herokuapp.com/maven-central/com.github.atomashpolskiy/bt-core/">
<img src="https://maven-badges.herokuapp.com/maven-central/com.github.atomashpolskiy/bt-core/badge.svg"
alt="Maven Central">
</a>
<a href="http://atomashpolskiy.github.io/bt/javadoc/latest/">
<img src="https://img.shields.io/badge/javadoc-latest-orange.svg"
alt="JavaDoc">
</a>
<a href="https://codecov.io/gh/atomashpolskiy/bt">
<img src="https://img.shields.io/codecov/c/github/atomashpolskiy/bt/master.svg"
alt="Coverage">
</a>
</p>
* **[HOME](http://atomashpolskiy.github.io/bt/)** – website with documentation and tutorials
* **[RELEASE NOTES](https://github.com/atomashpolskiy/bt/blob/master/RELEASE-NOTES.md#bt-release-notes)** – list of features, bugfixes and improments for each version
* **[UPGRADE INSTRUCTIONS](https://github.com/atomashpolskiy/bt/blob/master/UPGRADE.md#upgrade-instructions)** – version migration guide
* **[FORUM](https://groups.google.com/forum/#!forum/bttorrent)** – Google group for support and feedback
* **[TROUBLESHOOTING](#troubleshooting)** - solutions for some common problems
* **[LICENSE](https://github.com/atomashpolskiy/bt/blob/master/LICENSE)** – licensed under Apache License 2.0
## Runnable apps and demos
* **[CLI](https://github.com/atomashpolskiy/bt/tree/master/bt-cli#simple-command-line-torrent-downloader)** – command-line downloader
* **[PEER TRACKER](https://github.com/atomashpolskiy/bt/tree/master/examples/src/main/java/peertracker#peer-tracker)** – tracking of swarm statistics via events
* **[YOURIP MESSENGER](https://github.com/atomashpolskiy/bt/tree/master/examples/src/main/java/yourip#yourip-messenger)** – usage of custom messages
## Media
* **[HABRAHABR.RU: Пишем свой BitTorrent клиент на базе библиотеки Bt](https://habrahabr.ru/post/350076/)** - Introductory article and demonstration of basic capabilities (in Russian)
* **[SMARTSPATE.COM: How To Write Your Own BitTorrent Client By Using Bt Library](https://www.smartspate.com/how-to-write-your-own-bittorrent-client-by-using-bt-library/)** - English translation of the above article
## Prerequisites
<sup>Currently, all peer connections are established via [encryption negotation protocol](http://wiki.vuze.com/w/Message_Stream_Encryption) (also called MSE handshake). If you're using Oracle JDK ([pre 8u152](http://www.oracle.com/technetwork/java/javase/8u152-relnotes-3850503.html)), in order to be able to connect to peers you must install [Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html). The reason for this requirement is that the [MSE RC4 cipher](http://wiki.vuze.com/w/Message_Stream_Encryption) uses 160 bit keys, while default Java installation allows at most 128 bit keys.</sup>
## Usage
Most recent version available in Maven Central is **1.7**.
Declare the following dependencies in your project’s **pom.xml**:
```xml
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-core</artifactId>
<version>${bt-version}</version>
</dependency>
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-http-tracker-client</artifactId>
<version>${bt-version}</version>
</dependency>
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-dht</artifactId>
<version>${bt-version}</version>
</dependency>
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-upnp</artifactId>
<version>${bt-version}</version>
</dependency>
```
## Building from source
```
git clone https://github.com/atomashpolskiy/bt.git
cd bt
mvn clean install -DskipTests
```
## Code sample
```java
// enable multithreaded verification of torrent data
Config config = new Config() {
@Override
public int getNumOfHashingThreads() {
return Runtime.getRuntime().availableProcessors() * 2;
}
};
// enable bootstrapping from public routers
Module dhtModule = new DHTModule(new DHTConfig() {
@Override
public boolean shouldUseRouterBootstrap() {
return true;
}
});
// get download directory
Path targetDirectory = new File("~/Downloads").toPath();
// create file system based backend for torrent data
Storage storage = new FileSystemStorage(targetDirectory);
// create client with a private runtime
BtClient client = Bt.client()
.config(config)
.storage(storage)
.magnet("magnet:?xt=urn:btih:af0d9aa01a9ae123a73802cfa58ccaf355eb19f1")
.autoLoadModules()
.module(dhtModule)
.stopWhenDownloaded()
.build();
// launch
client.startAsync().join();
```
## What makes Bt stand out from the crowd
### Flexibility
Being built around the [Guice](https://github.com/google/guice) DI, **Bt** provides many options for tailoring the system for your specific needs. If something is a part of Bt, then it can be modified or substituted for your custom code.
### Custom backends
**Bt** is shipped with a standard file-system based backend (i.e. you can download the torrent file to a storage device). However, the backend details are abstracted from the message-level code. This means that you can use your own backend by providing a _storage unit_ implementation.
### Protocol extensions
One notable customization scenario is extending the standard BitTorrent protocol with your own messages. BitTorrent's [BEP-10](http://www.bittorrent.org/beps/bep_0010.html) provides a native support for protocol extensions, and implementation of this standard is already included in **Bt**. Contribute your own _Messages_, byte manipulating _MessageHandlers_, message _consumers_ and _producers_; supply any additional info in _ExtendedHandshake_.
### Test infrastructure
To allow you test the changes that you've made to the core, **Bt** ships with a specialized framework for integration tests. Create an arbitrary-sized _swarm_ of peers inside a simple _JUnit_ test, set
没有合适的资源?快使用搜索试试~ 我知道了~
bt master 开源 纯java实现 bt 项目

共726个文件
java:652个
xml:15个
md:11个


温馨提示
开源bittorrent协议实现,想学习或者做bt项目的同学可以参考。包含bencode,DHT,bittorrent 的完整实现
资源推荐
资源详情
资源评论





















收起资源包目录





































































































共 726 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论

- 嘉辉_20132019-03-02不太好用,迅雷能下的这个都不能下pwijkbije2019-07-12迅雷有自己的服务器扩展,不是不是纯p2p,这个就是下载来研究一下还是不错的

pwijkbije
- 粉丝: 8
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 工程项目管理方法的核心方法.docx
- 计算机网络技术与应用试题库.doc
- 计算机三级(网络技术)笔试275.pdf
- 电子商务产业园项目可行性研究报告.doc
- 基于YOLOv8深度学习的磁瓦表面缺陷自动化检测:实验结果与效率分析 · YOLOv8 v2.1
- 计算机网络专业学生实习报告范文.doc
- 情侣装网络营销策划方案样本.doc
- 医药电商市场现状和发展态势互联网事业部培训.ppt
- 基于HTML5的响应式网站的设计与实现论文正文.docx
- 会展策划第七章第一节会展项目管理的基本理论ppt课件.ppt
- 系统集成项目管理工程师复习小结.doc
- 内河水运建设项目管理指标体系及信息系统开发设想.doc
- 因特网信息交流与网络安全教学设计(整理).pdf
- 虚拟化项目验收报告模板.docx
- 最新国家开放大学电大《优秀广告作品评析(专)》网络核心课形考网考作业及答案.pdf
- 综合布线设计的若干要点.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
