Full-featured BitTorrent client package and utilities
翻译准备中
开发工具GitHub @anacrolix自行安装运营者未确认
试用过了吗? 点一下就好,无需登录。
尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗This repository implements BitTorrent-related packages and command-line utilities in Go. The emphasis is on use as a library from other projects. It's been used 24/7 in production by downstream services since late 2014. The implementation was specifically created to explore Go's concurrency capabilities, and to include the ability to stream data directly from the BitTorrent network. To this end it supports seeking, readaheads and other features exposing torrents and their files with the various Go idiomatic io package interfaces. This is also demonstrated through torrentfs.
There is support for protocol encryption, DHT, PEX, uTP, WebTorrent, WebSeeds, BitTorrent v2, holepunching, and many more features and BEPs. There are several data storage backends provided: blob, file, bolt, mmap, and sqlite, to name a few. You can write your own to store data for example on S3, or in a database.
Some noteworthy package dependencies that can be used for other purposes include:
See CHANGELOG.md for a detailed list of changes by version.
Install the library package with go get github.com/anacrolix/torrent, or the provided cmds with go install github.com/anacrolix/torrent/cmd/...@latest. Installing by import path like this runs in Go's module-aware mode and ignores the repository's go.work file, so it works without checking out any git submodules.
The repository includes a Go workspace (go.work) that adds the possum storage backend. possum is vendored as a git submodule at storage/possum/lib, and the workspace references the Go module inside it (storage/possum/lib/go). Building from a clone of this repository (for example go build ./...) therefore requires the submodule to be checked out, otherwise Go fails with an error like:
cannot load module storage/possum/lib/go listed in go.work file: open storage/possum/lib/go/go.mod: no such file or directory
Check out the submodules when cloning:
git clone --recurse-submodules https://github.com/anacrolix/torrent
or, in an existing clone:
git submodule update --init --recursive
Alternatively, disable the workspace by setting GOWORK=off, though the possum storage backend won't be available in that case.
There are some small examples in the package documentation.
To dial peers through a SOCKS5 proxy, add the dialer.Socks5 dialer to the client. Start from the default config and set DialForPeerConns to false so the SOCKS5 dialer is the only one used for outgoing peer connections:
cfg := torrent.NewDefaultClientConfig()
cfg.DialForPeerConns = false
cl, _ := torrent.NewClient(cfg)
cl.AddDialer(dialer.NewSocks5("localhost:1080", nil))
The proxy is used for outgoing peer connections; listening for incoming connections is unaffected.
There are several web-frontends, sites, Android clients, storage backends and supporting services among the known public projects:
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗