⚡️ Streaming torrent client for the web

Overview


WebTorrent
WebTorrent

The streaming torrent client. For node.js and the web.

discord ci npm version npm downloads Standard - JavaScript Style Guide

Sponsored by    Brave    Wormhole    ExpressVPN

WebTorrent is a streaming torrent client for node.js and the browser. YEP, THAT'S RIGHT. THE BROWSER. It's written completely in JavaScript – the language of the web – so the same code works in both runtimes.

In node.js, this module is a simple torrent client, using TCP and UDP to talk to other torrent clients.

In the browser, WebTorrent uses WebRTC (data channels) for peer-to-peer transport. It can be used without browser plugins, extensions, or installations. It's Just JavaScript™. Note: WebTorrent does not support UDP/TCP peers in browser.

Simply include the webtorrent.min.js script on your page to start fetching files over WebRTC using the BitTorrent protocol, or require('webtorrent') with browserify. See demo apps and code examples below.

jsdelivr download count

To make BitTorrent work over WebRTC (which is the only P2P transport that works on the web) we made some protocol changes. Therefore, a browser-based WebTorrent client or "web peer" can only connect to other clients that support WebTorrent/WebRTC.

To seed files to web peers, use a client that supports WebTorrent, e.g. WebTorrent Desktop, a desktop client with a familiar UI that can connect to web peers, webtorrent-hybrid, a command line program, or Instant.io, a website. Established torrent clients like Vuze have already added WebTorrent support so they can connect to both normal and web peers. We hope other clients will follow.

Network

Features

  • Torrent client for node.js & the browser (same npm package!)
  • Insanely fast
  • Download multiple torrents simultaneously, efficiently
  • Pure Javascript (no native dependencies)
  • Exposes files as streams
    • Fetches pieces from the network on-demand so seeking is supported (even before torrent is finished)
    • Seamlessly switches between sequential and rarest-first piece selection strategy
  • Supports advanced torrent client features
  • Comprehensive test suite (runs completely offline, so it's reliable and fast)

Browser/WebRTC environment features

  • WebRTC data channels for lightweight peer-to-peer communication with no plugins
  • No silos. WebTorrent is a P2P network for the entire web. WebTorrent clients running on one domain can connect to clients on any other domain.
  • Stream video torrents into a <video> tag (webm (vp8, vp9) or mp4 (h.264))
  • Supports Chrome, Firefox, Opera and Safari.

Sauce Labs

Install

To install WebTorrent for use in node or the browser with require('webtorrent'), run:

npm install webtorrent

To install a webtorrent command line program, run:

npm install webtorrent-cli -g

To install a WebTorrent desktop application for Mac, Windows, or Linux, see WebTorrent Desktop.

Ways to help

Who is using WebTorrent today?

Lots of folks!

WebTorrent API Documentation

Read the full API Documentation.

Usage

WebTorrent is the first BitTorrent client that works in the browser, using open web standards (no plugins, just HTML5 and WebRTC)! It's easy to get started!

In the browser

Downloading a file is simple:
var WebTorrent = require('webtorrent')

var client = new WebTorrent()
var magnetURI = '...'

client.add(magnetURI, function (torrent) {
  // Got torrent metadata!
  console.log('Client is downloading:', torrent.infoHash)

  torrent.files.forEach(function (file) {
    // Display the file by appending it to the DOM. Supports video, audio, images, and
    // more. Specify a container element (CSS selector or reference to DOM node).
    file.appendTo('body')
  })
})
Seeding a file is simple, too:
var dragDrop = require('drag-drop')
var WebTorrent = require('webtorrent')

var client = new WebTorrent()

// When user drops files on the browser, create a new torrent and start seeding it!
dragDrop('body', function (files) {
  client.seed(files, function (torrent) {
    console.log('Client is seeding:', torrent.infoHash)
  })
})

There are more examples in docs/get-started.md.

Browserify

WebTorrent works great with browserify, an npm package that lets you use node-style require() to organize your browser code and load modules installed by npm (as seen in the previous examples).

Webpack

WebTorrent also works with webpack, another module bundler. However, webpack requires the following extra configuration:

{
  target: 'web',
  node: {
    fs: 'empty'
  }
}

Or, you can just use the pre-built version via require('webtorrent/webtorrent.min.js') and skip the webpack configuration.

Script tag

WebTorrent is also available as a standalone script (webtorrent.min.js) which exposes WebTorrent on the window object, so it can be used with just a script tag:

<script src="webtorrent.min.js"></script>

The WebTorrent script is also hosted on fast, reliable CDN infrastructure (Cloudflare and MaxCDN) for easy inclusion on your site:

<script src="https://cdn.jsdelivr.net/npm/webtorrent@latest/webtorrent.min.js"></script>
Chrome App

If you want to use WebTorrent in a Chrome App, you can include the following script:

<script src="webtorrent.chromeapp.js"></script>

Be sure to enable the chrome.sockets.udp and chrome.sockets.tcp permissions!

In Node.js

WebTorrent also works in node.js, using the same npm package! It's mad science!

NOTE: To connect to "web peers" (browsers) in addition to normal BitTorrent peers, use webtorrent-hybrid which includes WebRTC support for node.

As a command line app

WebTorrent is also available as a command line app. Here's how to use it:

$ npm install webtorrent-cli -g
$ webtorrent --help

To download a torrent:

$ webtorrent magnet_uri

To stream a torrent to a device like AirPlay or Chromecast, just pass a flag:

$ webtorrent magnet_uri --airplay

There are many supported streaming options:

--airplay               Apple TV
--chromecast            Chromecast
--mplayer               MPlayer
--mpv                   MPV
--omx [jack]            omx [default: hdmi]
--vlc                   VLC
--xbmc                  XBMC
--stdout                standard out [implies --quiet]

In addition to magnet uris, WebTorrent supports many ways to specify a torrent.

Talks about WebTorrent

Modules

Most of the active development is happening inside of small npm packages which are used by WebTorrent.

The Node Way™

"When applications are done well, they are just the really application-specific, brackish residue that can't be so easily abstracted away. All the nice, reusable components sublimate away onto github and npm where everybody can collaborate to advance the commons." — substack from "how I write modules"

node.js is shiny

Modules

These are the main modules that make up WebTorrent:

module tests version description
webtorrent torrent client (this module)
bittorrent-dht distributed hash table client
bittorrent-peerid identify client name/version
bittorrent-protocol bittorrent protocol stream
bittorrent-tracker bittorrent tracker server/client
bittorrent-lsd ] bittorrent local service discovery
create-torrent create .torrent files
magnet-uri parse magnet uris
parse-torrent parse torrent identifiers
render-media intelligently render media files
torrent-discovery find peers via dht, tracker, and lsd
ut_metadata metadata for magnet uris (protocol extension)
ut_pex peer discovery (protocol extension)

Enable debug logs

In node, enable debug logs by setting the DEBUG environment variable to the name of the module you want to debug (e.g. bittorrent-protocol, or * to print all logs).

DEBUG=* webtorrent

In the browser, enable debug logs by running this in the developer console:

localStorage.debug = '*'

Disable by running this:

localStorage.removeItem('debug')

License

MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.

Comments
  • Idea: WebSockets as an alternative to WebRTC

    Idea: WebSockets as an alternative to WebRTC

    Lots of torrent clients can't add WebRTC support because the protocol is too complicated and difficult to integrate. This is slowing WebTorrent adoption in traditional desktop torrent clients. See https://github.com/transmission/transmission/issues/47, for example.

    I've been thinking about this a bit. It's probably possible to make something work over WebSockets. Here's a rough sketch.

    1. Desktop peers would run a WebSocket server and do whatever NAT hole punching they normally do (UPnP, NAT-PMP, tell the user to set up static port mapping, or just hope that the user has a public IP).

    2. Browser peers would discover desktop peers through normal means, so probably trackers and PEX for now (and eventually we could extend the DHT to support WebSocket in addition to UDP).

    3a. Browser peers connect to desktop peers using WebSocket using an address like ws://12.34.56.78 when possible.

    3b. One complication is that the browser blocks connections to insecure origins (ws://) from secure origins (https://). So ws:// can't be used all of the time. Ideally, we could use wss:// instead. However that requires the WebSocket server to have a domain name and a certificate signed by a CA. 😢

    3c. Here's a workaround. Say a user on a secure web origin wants to connect to a desktop peer at 12.34.56.78. They would connect to wss://12-34-56-78.force-tls.com. The force-tls.com domain would have DNS set up to return whatever IP is passed in the subdomain. So the DNS for 12-34-56-78.force-tls.com would resolve to 12.34.56.78. The force-tls.com domain would use wildcard certificate to ensure that all of these domains are signed. The secret key for this certificate would be public and any torrent app could use it in their WebSocket server.

    3d. So, in this system, TLS isn't actually being used for security. This is just a hack to help secure origins (https://) connect to WebSocket servers running in desktop peers without requiring those desktop peers to buy a domain name and get a TLS certificate that is trusted by the browser peers' browsers.

    3e. Anyone could run one of these "force TLS" services cheaply. They're generic and have nothing to do with the BitTorrent protocol, so it's likely risk-free to just run one of these as a public service, not unlike a DHT bootstrap node. It's just a DNS server that maps 12-34-56-78.force-tls.com to the IP address 12.34.56.78.

    1. Browser to browser connections, as well as desktop to browser connections would continue to require WebRTC. But if a desktop client does not want to support WebRTC (understandably), then they can still provide value to browser peers by running a WebSocket server to allow browser peers to initiate connections to them.

    Thoughts?

    (I originally brainstormed this idea with @mafintosh and I was inspired by @diasdavid's work on js-ipfs.)

    question stale area/protocol 
    opened by feross 71
  • Implement Web (HTTP) Seeding (BEP17+BEP19)

    Implement Web (HTTP) Seeding (BEP17+BEP19)

    Web / HTTP seeding is an extension to standard bittorrent p2p which allows a client to download ranges from normal HTTP servers in addition to standard bittorrent peers. This has the advantage of effectively adding permanent, seed-only peers to any swarm, and it's very easy for any existing HTTP fileservers to facilitate bittorrent and also reduce their own load by offloading portions of normal HTTP downloads to bittorrent peers.

    I think this feature will be particularly important to the browser version, since we're expecting the number of hybrid peers to be relatively low compared with normal bittorrent clients, and HTTP-based peers will be supported in the browser without any workarounds.

    Note that there are two competing standards for HTTP seeding, both with their own pros / cons, and I believe most clients implement them both since neither is very complex. The nomenclature used to refer to the standards is very inconsistent, so for the purposes of webtorrent, I propose we refer them simply as BEP19 (aka GetRight-style http/ftp seeding) and BEP17 (aka Hoffman-style, http seeding, webseeding).

    BEP19 has the advantage of being able to work with any file accessible via normal HTTP or FTP, utilizing standard HTTP range requests to download pieces (or better yet reserved spans of pieces to minimize separate HTTP requests). BEP17 requires external servers to be modified to support BEP17, which is a disadvantage in terms of interoperability, but it does have the advantage of allowing the seeding servers to better control traffic and avoid bandwidth abuse.

    This task will require modifying parse-torrent to recognize HTTP seed servers. It will also require changes to bittorrent-swarm, possibly bittorrent-protocol, and bittorrent-client if we want to support more efficient utilization of HTTP by reserving spans of pieces for each individual HTTP seed request as opposed to treating HTTP seed peers as normal peers and requesting single blocks at a time from them.

    Resources:

    • High level overview of HTTP seeding and protocols
    • Vuze wiki's overview of its HTTP seeding implementation
    enhancement help wanted area/browser area/node 
    opened by transitive-bullshit 65
  • Add proxy options to allow proxying tracker and peer connections

    Add proxy options to allow proxying tracker and peer connections

    This PR is based on feross/bittorrent-tracker#157 to proxy tracker connnections and adds proxying on TCP peers and webseeds.

    WebRTC peers in webtorrent-hybrid is ok now electron-webrtc has been updated.

    Options are structured like :

    proxyOpts: {
        socksProxy: {
          proxy: {
            ipAddress: 'localhost',
            port: 1080,
            type: 5
          }
        },
        proxyTrackerConnections: true,
        proxyPeerConnections: false,
        httpAgent: {},
        httpsAgent: {}
    }
    

    Any thoughts?

    Fixes #807

    enhancement stale 
    opened by yciabaud 50
  • How does WebTorrent work?

    How does WebTorrent work?

    Let me try to clear up a little confusion about what WebTorrent is and how it works.

    The goal of the project is to build a browser BitTorrent client that requires no install (no plugin/extension/etc.) and interoperates with the regular BitTorrent network, though it uses WebRTC Data Channels for peer-to-peer transport.

    To accomplish that goal, I have two objectives.

    The first is to develop a working JavaScript BitTorrent client as a Chrome App. This is now finished, though we still need to add support for additional features and polish to bring it on par with other modern clients. I did this first to learn how existing clients work and because lots of this code will be reused by the WebRTC client.

    The second objective is to make the BitTorrent protocol work over WebRTC. The protocol obviously needs some modifications, but all the main concepts will remain intact. This new protocol will be called "the WebTorrent protocol", or "WebTorrent extensions".

    We'll use this new protocol to ship a standalone JS file that webmasters can add to their site if they want to fetch files over webtorrent. All they need to provide is the info hash (or a .torrent file) (or a magnet uri) and the WebTorrent script will do the rest. We'll have a good default "viewer" UI depending on the file type: PDF viewer, image viewer, audio/video tag (if the format allows for streaming), etc. and also allow the programmer to get the data programmatically without UI too.

    This standalone JS file will eventually be the primary WebTorrent client that most users interact with. Eventually, I hope that popular tracker sites will add it to their site to make consuming torrent content easier.

    So, why the Chrome App?

    We'll add support for the WebTorrent protocol to the Chrome App so it will speak both protocols, meaning it can connect to both normal and web-based clients. This accomplishes two things:

    • With a reasonably large install base using the Chrome App, we'll have lots of users to test out the WebTorrent protocol with. We can fine-tune it on real users before we actually ship anything or make any promises about performance. The Chrome App will simply update with better and better WebTorrent support, and they won't have to do a thing.
    • The first time a Chrome App client downloads a torrent that no other WebTorrent client is seeding, they become the first WebTorrent seeder. They essentially "bring" the file into the WebTorrent network.

    Remember, until mainstream BitTorrent clients support WebTorrent, the web-based clients using the standalone JS file can only download from from other web-based clients. Browsers can't open arbitrary tcp/udp connections -- just WebRTC connections. So, essentially, we're bootstrapping the WebTorrent network by "bridging" it with the existing BitTorrent network.

    Eventually, mainstream BitTorrent clients could add support for WebTorrent by using libjingle or other WebRTC bindings (see node-webrtc) so that WebTorrent clients can directly connect to them.

    Questions/feedback welcome.

    UPDATE: Now planning to use node-webkit to release native binaries for all major platforms instead of a chrome app, due to excessive chrome app CSP restrictions which make development not fun.

    question 
    opened by feross 43
  • Handle large files better in the browser

    Handle large files better in the browser

    _Moving this issue from https://github.com/feross/instant.io/issues/3 to here, for better visibility._

    After lots of work on fixing memory leaks, I was able to seed a 1GB video from Firefox and stream it to Chrome! But there are still issues:

    • [x] Can't seed files larger than 500MB in Chrome due to a chromium bug.
    • [x] Can't seed or download files larger than 1GB because of a buffer limitation. This limitation comes from V8 and we could probably lift this limit in feross/buffer and improve the situation in Firefox.

    Besides fixing the above issues, future work should include using browser storage (#86) to get this data out of memory.


    Update (5/26/2015):

    • Chrome supports seeding and video streaming (i.e. downloading) files up to 1GB now, due to this PR that implements streaming blob reading in the filestream package! Downloading via the download blob link is still limited to 500MB until the chromium bug is fixed.
    help wanted area/browser 
    opened by feross 31
  • Client tries to download entire file in one request

    Client tries to download entire file in one request

    What version of WebTorrent? WebTorrent/0.98.19, according to the webseed apache log

    What operating system and Node.js version? Ubuntu 16.04 Node.js v5.12.0

    What browser and version? (if using WebTorrent in the browser) Not using WebTorrent in the browser.

    What did you expect to happen? I wrote a little script with create-torrent module to, well, create a torrent file out of a text file (169 MB). The file, on the start, is only available in a webseed.

    I expected the client to make requests of the correct length of the piece, and not get stuck :(.

    What actually happened? When I try to download it with the Webtorrent client, it does a big request, as if downloading the entire file in one request. Trying to debug, I added this snippet to client.add():

        torrent.on('download', function(bytes){
            console.log('just got %d bytes', bytes);
        });
    

    The output is: just got 176917572 bytes, which is the entire file size, when the pieceLength specified on the create-torrent is 65536, so it doesn't make any sense. Then it gets stuck. It stop making requests and no more outputs are given.

    Watching the apache access.log while executing the client, I got only this: 127.0.0.1 - - [25/Oct/2017:10:19:57 -0200] "GET /filename.txt HTTP/1.1" 200 429899 "-" "WebTorrent/0.98.19 (https://webtorrent.io)" Apparently, 429899 is the size of the content in response. (And HTTP code 200 means it's not partial, which would be HTTP code 206).

    I tried with some other clients (transmission and a libtorrent python one) and it works perfectly. With some other files, even the Webtorrent works, but not in this one.

    area/node need more info 
    opened by jedian 27
  • Let's make a WebTorrent sticker!

    Let's make a WebTorrent sticker!

    Calling everyone with graphical design skills!

    We need a logo for webtorrent.io, as well as a hex sticker design for our laptops!

    Hex stickers are awesome because you can tile them. Check out what my laptop looks like:

    After we have a sticker design, I'll print a bunch and send them to anyone who wants one.

    help wanted 
    opened by feross 27
  • Bring torrents to the browser (chrome extension)

    Bring torrents to the browser (chrome extension)

    Hi everyone

    I'm new on this git, but I just wanted to share my idea and see your reactions.

    So, what if we created/used a chrome/Firefox extension that downloads and seeds torrent files over the bittorrent and webtorrent network. This way we can close the gap between these networks. And make a 100% browser side torrent client.

    From a user's perspective:

    • goes to website
    • wants to download torrent/play video
    • a) torrent file is available on webtorrent network -> starts direct download -> seeds to webtorrent network
    • b) torrent file is not available on webtorrent -> is asked to install extension -> starts to download -> seeds to webtorrent network (&bittorrent)
    stale 
    opened by ghost 27
  • Implement Protocol Encryption (PE/MSE)

    Implement Protocol Encryption (PE/MSE)

    Protocol encryption (PE) aka message stream encryption (MSE) is a bittorrent extension to enhance privacy and confidentiality, effectively making bittorrent traffic harder to identify and throttle by ISPs.

    Note that there is no official BEP describing protocol encryption, but it is widely supported by all the top clients.

    At a high level, there are two different levels of bittorrent encryption that exist, namely those which only encrypt bittorent headers, and stronger encryption such as RC4 which encrypts the entire stream. I'm guessing that webtorrent will want to eventually support both, but I'd recommend implementing the header-level encryption first since webtorrent is already heavily burdened by all the SHA1 hashes going on.

    bittorrent-clients should accept encryption options similar to those described here; e.g., encrypted connections should be either disabled, enabled and optional (e.g. prefer encryption but fallback to unencrypted if the remote peer doesn't support encryption), or enabled and forced (e.g., only connect to peers supporting encryption).

    Resources:

    enhancement help wanted area/browser area/node accepted 
    opened by transitive-bullshit 26
  • Resumable downloads / seed existing downloads

    Resumable downloads / seed existing downloads

    It should be possible to start seeding as soon as a torrent is "downloaded" if the contents are found in the output directory. This is how Transmission works on the CLI. The functionality would be especially useful for webtorrent-hybrid.

    enhancement help wanted area/node 
    opened by misterhat 24
  • Magnet link with web seed does not work

    Magnet link with web seed does not work

    Hi, i'm trying to make streaming to a HTML5 video tag. Here is my full code:

    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>Web Torrent Player</title>
        <script src="https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js"></script>
    
    </head>
    <body style="background-color: black">
    
        <script>
            var showPlayer = function (){
    
                console.log('Creating WebTorrent Client..');
                var client = new WebTorrent();
                var magnetUri = 'magnet:?xt=urn:btih:4cb67059ed6bd08362da625b3ae77f6f4a075705&dn=bl001-introduction.webm&tr=http%3A%2F%2Ft.bitlove.org%2Fannounce&ws=http%3A%2F%2Fspaceboyz.net%2F%7Eastro%2Fbitlove-show%2Fbl001-introduction.webm';
    
                if(!client){
                    console.log('ERROR creating WebTorrent Client!');
                    return;
                }
    
                console.log('Adding torrent url..');
                client.add(magnetUri, function (torrent) {
                    // Got torrent metadata!
                    console.log('Torrent info hash:', torrent.infoHash);
    
                    // Let's say the first file is a webm (vp8) or mp4 (h264) video...
                    var file = torrent.files[0];
    
                    // Create a video element
                    var video = document.createElement('video');
                    video.controls = true;
                    document.body.appendChild(video);
    
                    // Stream the video into the video tag
                    file.createReadStream().pipe(video);
                });
            }
    
            // loads the player
            showPlayer();
    
        </script>
    </body>
    </html>
    

    I'm getting different errors on the client.add(..) call, on firefox and chrome:

    On firefox 38.0 on Ubuntu, i get this on the console:

    "TypeError: a.parsedTorrent.pieces is undefined webtorrent.min.js:2:930"

    On chrome 43.0.2357.125 on Ubuntu, i get this other error on the console:

    "webtorrent.min.js:2 Uncaught TypeError: Cannot read property 'length' of undefined"

    As the client.add(..) call fails, the video tag can't even load.

    opened by marianobrc 23
  • Deselect was not working

    Deselect was not working

    Deselect was not working especially if you first "select" a file with a specific priority, then it will never be "deselected"

    What is the purpose of this pull request? (put an "X" next to item)

    [ ] Documentation update [X ] Bug fix [ ] New feature [ ] Other, please explain:

    What changes did you make? (Give an overview) I have changed file.js calling a new method in torrent.js. I have created a method deselect in torrent.js which doesn't care about priority because if you want to deselect a file you want that will not be downloaded. I have not deleted the previous deselect method because maybe can be used elsewhere, if not it can be deleted. I have updated the docs too

    Which issue (if any) does this pull request address? #164

    Is there anything you'd like reviewers to focus on? If is possible to write some test about it or if there is some guide on how to write it well

    opened by drakonkat 0
  • Make WebTorrent more IPFS-friendly by better handling IPFS URLs used as webseeds

    Make WebTorrent more IPFS-friendly by better handling IPFS URLs used as webseeds

    Make WebTorrent more IPFS-friendly by better handling IPFS URLs used as webseeds

    When an URL for a file on the IPFS network is served through a public IPFS gateway and used as source in a video element, the IPFS companion browser extension can rewrite the request so that it points to the localhost, like this:

    https://ipfs.io/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR → http://localhost:8080/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR → http://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi.ipfs.localhost:8080

    Unfortunately, the same isn’t true when WebTorrent process a public IPFS gateway URL used as a webseed for a torrent. In this case, the companion extension (apparently) doesn’t see the request to rewrite it and WebTorrent just tries to load the file through the public gateway, which is less than ideal, specially for large files.

    With that said, I suggest that WebTorrent should better handle public IPFS gateway URLs as to work in conjunction with the IPFS companion extension, making possible for it to rewrite them as it already does for HTML elements. If that isn’t feasible right now or would take a long time to be implemented, then implement a workaround: when WebTorrent detects a public IPFS gateway URL used as webseed, automatically rewrite it to a path-like URL served by the localhost or, if it detects a native IPFS URL using the “ipfs:” protocol, rewrite it as a subdomain gateway URL. After rewriting it and making the request, wait for a 206 HTTP response. If it comes, just let the connection proceeds; if it doesn’t, then ditch the localhost URL and go back to the public gateway URL or, it was a native URL, just discard it. The URLs would look like this:

    https://gateway-host.tld/ipfs/{cid} → http://localhost:8080/ipfs/{cid}

    ipfs://{cidv1} → http://{cidv1}.ipfs.localhost:8080

    By making WebTorrent more IPFS-friendly some websites could more easily bridge the gap between a centralized web and a fully decentralized one: they could host all the static files on an IPFS node and publish them using their own public IPFS gateway and then, for audio and video files, they could also use WebTorrent, with the IPFS URLs serving as webseeds.

    To try out IPFS URLs as webseeds:

    1. Install the IPFS desktop
    2. Install the IPFS companion on the browser you will use for testing;
    3. Import a file (preferably a large file) to your local IPFS node;
    4. Create a torrent for that same file using instant.io or btorrent.xyz and get its magnet link;
    5. Get a public IPFS gateway URL to that file using the “Share link” option;
    6. Add that IPFS URL to the magnet link as a webseed by adding the parameter “ws=[URL]” to the magnet link (use “&” before/after it to add it to the magnet link);
    7. Go and try to torrent it using the browser on which you installed the companion extension;
    8. Now change the public IPFS gateway URL from the magnet link to the path-like localhost URL for the same file and try to torrent it again.

    P.S.: I am not a developer, so I’m here as a user to propose such a feature, discuss it and test if it gets implemented.

    opened by hollownights 0
  • chore(deps): update actions/stale action to v7

    chore(deps): update actions/stale action to v7

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/stale | action | major | v6 -> v7 |


    Release Notes

    actions/stale

    v7

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependencies 
    opened by renovate[bot] 0
  • Drop peers which feed incorrect pieces multiple times

    Drop peers which feed incorrect pieces multiple times

    What version of this package are you using? 1.9.6 What problem do you want to solve? Indefinite stalling when a peer keeps sending invalid pieces.

    I encountered this issue when downloading a torrent which people applied patches to without verifying it, webtorrent was constantly re-requesting pieces from that one peer, which caused the download to stall. What do you think is the correct solution to this problem? Drop interest in peer after X failed hashes? Maybe don't use that specific peer for that piece and pick another one? Are you willing to submit a pull request to implement this change? yes

    accepted 
    opened by ThaUnknown 0
  • chore: docs

    chore: docs

    What is the purpose of this pull request? (put an "X" next to item)

    [X] Documentation update [X] Bug fix [ ] New feature [ ] Other, please explain:

    What changes did you make? (Give an overview) This updates docs to v2's changes, a lot of which went undocumented because well.. I wasn't sure of them.

    Notable changes:

    instead of using jsdelivr we now suggest esm.sh, they don't actually correctly compile webtorrent YET, but that's likely to change very soon, this is more future-proofing than anything. Upside of esm.sh is that it's packages aren't bundled like when we said to use the built file of webtorrent, meaning module de-duping if they use esm.sh for other modules.

    added webpack suggestions with browserify in a lot more places, as a proper webpack config will yield an almost 80% smaller bundle size, with links to out webpack config

    in some places I used navigator.serviceWorker.ready it's not exactly the correct way of registering the worker, but it's simpler and less code, worst case is that streams won't support cancelling instead use 5s timeouts on the first time the service worker is loaded

    fixed a few issues which I found during writing of the docs and with real-world tests

    removed all instances of getBlobURL, mainly because blob url's are browser only, while blobs are now cross-platform, so it's simpler to just tell the user to wrap it themselves, the URL.createObjectURL API is sync anyways

    changed almost all references of Buffer to Uint8Array, this isn't fully breaking as buffer extends Uint8Array anyways, with one notable exception that Buffer.slice acts like Uint8Array.subarray

    opened by ThaUnknown 0
  • fix(deps): update dependency streamx to ^2.13.0

    fix(deps): update dependency streamx to ^2.13.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | streamx | ^2.12.5 -> ^2.13.0 | age | adoption | passing | confidence |


    Release Notes

    streamxorg/streamx

    v2.13.0

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependencies 
    opened by renovate[bot] 0
Releases(v1.9.6)
Owner
WebTorrent
⚡️⚡️⚡️ Streaming torrent client for the web, Node.js, Mac, Windows, & Linux.
WebTorrent
torrent-stream + chromecast

peercast torrent-stream + chromecast npm install -g peercast Usage Be on the same wifi as your chromecast and do peercast magnet:?xt=urn:btih:99feae0

Mathias Buus 503 Dec 15, 2022
Machine learning platform for Web developers

A JavaScript application framework for machine learning and its engineering. Builds Build Types Status tests pipeline release documentation docker Why

Alibaba 2.4k Dec 29, 2022
Yet another Linux distribution for voice-enabled IoT and embrace Web standards

YodaOS is Yet another Linux Distribution for voice-enabled IoT and embrace Web standards, thus it uses JavaScript as the main application/scripting la

YODAOS Project 1.2k Dec 22, 2022
Mad science p2p pipe across the web using webrtc that uses your Github private/public key for authentication and a signalhub for discovery

webcat Mad science p2p pipe across the web using webrtc that uses your Github private/public key for authentication and a signalhub for discovery We a

Mathias Buus 428 Dec 30, 2022
Streaming torrent client for node.js

peerflix Streaming torrent client for Node.js npm install -g peerflix Usage Peerflix can be used with a magnet link or a torrent file. To stream a vi

Mathias Buus 6k Dec 29, 2022
⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

⚡️Blitz 12.5k Jan 4, 2023
Webrtc, & web socket based streaming live video streaming and chatting platform. Written in Node, Typescript, and Javascript!

Live Streaming!! Welcome to my implementation of live streaming along with real time chat. I'm going to make a live streaming platform that will supoo

Hamdaan Khalid 19 Nov 23, 2022
Pim 4 Jun 21, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
torrent-stream + chromecast

peercast torrent-stream + chromecast npm install -g peercast Usage Be on the same wifi as your chromecast and do peercast magnet:?xt=urn:btih:99feae0

Mathias Buus 503 Dec 15, 2022
Adds links to Discogs pages from various sites. Auto search for music on torrent and other sites. Does multi auto-search on Artist/Discography pages. Auto search local HDDs/filelists using Voidtools Everything search engine.

Discogs Scout: Adds links to Discogs pages from various sites. Auto search for music on torrent and other sites. Does multi auto-search on Artist/Disc

null 27 Dec 27, 2022
A JavaScript library for EASILY fetching info from TheMovieDB API with support for torrent file names.

TheMovieDB-API-Wrapper.js A easy to use, pure vanilla JavaScript API wrapper for TheMovieDB Show your support! A JavaScript library for easily fetchin

Marketing Pipeline 5 Dec 2, 2022
TikTokLive-Widget: A socket client/server program that exposes a widget with alerts (such as gifts, followers ...) for a specific user streaming on Tik Tok Live platform

TikTokLive-Widget: A socket client/server program that exposes a widget with alerts (such as gifts, followers ...) for a specific user streaming on Tik Tok Live platform

null 3 Dec 3, 2022
A transparent, in-memory, streaming write-on-update JavaScript database for Small Web applications that persists to a JavaScript transaction log.

JavaScript Database (JSDB) A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to

Small Technology Foundation 237 Nov 13, 2022
A self-hosted, completely private and free music streaming server compatible with Synology Audio Station's web browser interface and smartphone apps.

Open Audio Server Open Audio Server is a music streaming server compatible with Audio Station by Synology. Audio Station creates your own private serv

null 91 Dec 11, 2022
make streaming http requests

hyperquest treat http requests as a streaming transport The hyperquest api is a subset of request. This module works in the browser with browserify. r

James Halliday 711 Sep 8, 2022
Grab Blogger & Google Photos, mp4upload.com,cloudvideo.tv, etc streaming link

Multi direct link Streaming & Downloader Grab Blogger & Google Photos, mp4upload.com, cloudvideo.tv, etc streaming link Leaguage : node react-native :

Khalis Afkari 21 Dec 13, 2022