Hello, I'm TJ
An inspirational programmer who recommends 10000 open source projects and tools

Today, TJ Jun felt old in a diving group. It turned out that today's young people don't know what Xunlei and magnetic link are!

However, for TJ Jun's generation, Xunlei may represent an era and a memory, so today we will introduce an open-source imitation Xunlei tool, WebTorrent
Strictly speaking, WebTorrent is not exactly a product imitating Xunlei. It is more like an enhanced version of Xunlei. Xunlei has some functions, but some Xunlei may not have them. Just like LeBron James, those stronger than him are not as fast as him, and those faster than him are not as strong as him.
WebTorrent is written in JavaScript language and realizes point-to-point transmission. It can not only be directly used as a BT download tool, but also be broadcast like Xunlei.
Because WebTorrent also supports BitTorrent transport protocol, like other BT download tools or, you are also transmitting and sharing data to others while downloading.
And because WebTorrent is completely completed by JavaScript language, it can be opened and used directly in the browser without downloading the client. TJ Jun's impression should be that this is the first download tool to be implemented in this way.
WebTorrent can efficiently complete file transfer directly on the browser side and broadcast while playing. Based on its adoption of WebRTC technology, WebTorrent will never make the younger generation who are used to only watching online playback feel uncomfortable.

You can understand WebTorrent as a P2P network for the whole web. WebTorrent clients running in one domain can connect to clients in any other domain, so as to achieve distributed effect and complete high-speed file sharing and transmission.
As an open source project, WebTorrent has also prepared rich tutorial documents to refer to novice users:

For example, guide users how to integrate WebTorrent with video player
<!DOCTYPE html> <html> <head> <title>Web Torrent Tutorial</title> <meta charset="UTF-8" /> <script src="//cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js"></script> </head> <body> <video id="video-container" controls="true"></video> <script> const client = new WebTorrent(); const torrentId = "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent"; client.add(torrentId, function (torrent) { // Torrents can contain many files. Let's use the .mp4 file const file = torrent.files.find(function (file) { return file.name.endsWith(".mp4"); }); // Render to a <video> element by providing an ID. Alternatively, one can also provide a DOM element. file.renderTo("#video-container", {}, () => { console.log("Ready to play!"); }); }); </script> </body> </html>
It also gives a quick example of how to download torrent in the browser:
const WebTorrent = require('webtorrent') const client = new WebTorrent() // Sintel, a free, Creative Commons movie const torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent' client.add(torrentId, function (torrent) { // Torrents can contain many files. Let's use the .mp4 file const file = torrent.files.find(function (file) { return file.name.endsWith('.mp4') }) // Display the file by adding it to the DOM. // Supports video, audio, image files, and more! file.appendTo('body') })
If you want to study, collect and use Yibo for the first time, hurry to get the warehouse address:
Click on the bottom card to pay attention to the official account "TJ Jun".
Reply "look down" to get the warehouse address
Pay attention to me and know a cow x, easy-to-use and interesting thing every day