Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Web (HTTP) Seeding (BEP17+BEP19) #67
Comments
This comment has been minimized.
This comment has been minimized.
|
Thanks for the summary. Agreed - this is super important for webtorrent.js. It's also exciting because it enables a CDN-like use-case for sites that I'd like to support like Internet Archive. They can enable webseed for everything, since they're already doing that. But when other visitors are online, then torrenting will happen :) One difference for webtorrent.js is that the webseeder will need to enable CORS for two reasons:
|
This comment has been minimized.
This comment has been minimized.
|
Is anybody working on this feature? Would somebody with a bit more experience in the code base be available for support when I try to implement this? |
This comment has been minimized.
This comment has been minimized.
|
As in DHT? |
This comment has been minimized.
This comment has been minimized.
|
@trevorstarick web seeding is unrelated to DHT. @thomasdelaet nobody's currently working on this, but we welcome any help :) I'd be happy to help you with any questions regarding an implementation. Either reply to this thread with specific questions or if you'd like to chat, feel free to reach out at fisch0920@gmail.com |
This comment has been minimized.
This comment has been minimized.
|
Is a JavaScript implementation of DHT still needed/wanted. I'm interested to help but not sure what or where to start. |
This comment has been minimized.
This comment has been minimized.
|
There is an existing DHT module used by webtorrent, bittorrent-dht, though it definitely still needs improvement. |
This comment has been minimized.
This comment has been minimized.
|
Isnt most of it build allready in the the https://git.popcorntime.io/stash/projects repo ? |
This comment has been minimized.
This comment has been minimized.
|
@macbroadcast the webtorrent project shares a few modules with popcorntime's underlying torrent engine (peerflix / torrent-stream) but is fundamentally different because it's aim is to work in the browser as well as in node. This thread is for one particular issue within the greater webtorrent project, and we're getting off-topic, so check out webtorrent.io for further details. |
This comment has been minimized.
This comment has been minimized.
|
Hmm I wasn't aware popcorn-time had moved away from using peerflix. Their httpstream could be useful. |
This comment has been minimized.
This comment has been minimized.
|
Sorry for the slightly off-topic comment, but @fisch0920 and @trevorstarick who were asking about JS DHT, you should check out: https://github.com/tsujio/webrtc-chord |
This comment has been minimized.
This comment has been minimized.
|
I have started to work on this. |
This comment has been minimized.
This comment has been minimized.
|
Awesome! You should join us on IRC at #webtorrent (freenode). |
This comment has been minimized.
This comment has been minimized.
|
A generous individual contacted me to express his interest in this feature. He's willing to put up $500 to see this feature finished. @miketamis What's the status of your work on web seeding? This would be a nice bonus for finishing a feature you were already working on! :) |
This comment has been minimized.
This comment has been minimized.
|
Situation is good, HTTP seeding is working (currently only BEP19 the one that supports standard HTTP) just currently refactoring webtorrent to make the addition more modular. |
This comment has been minimized.
This comment has been minimized.
|
@miketamis can you send a PR for web seed support, or send a link to your in-progress work on web seeding? I'd like to take a look at it. |
This comment has been minimized.
This comment has been minimized.
|
any news? |
This comment has been minimized.
This comment has been minimized.
|
FTP seeding is described in BEP19. GetRight supports FTP seeding. The browser can download at any point (or at the beginning at worst case) of the file via FTP and seed (upload) via BitTorrent. Are there any technical limitations to not implement FTP support in WebTorrent? |
This comment has been minimized.
This comment has been minimized.
|
My bad; it's been awhile since I've looked at them :) |
This comment has been minimized.
This comment has been minimized.
|
I don't think it's possible to do FTP in the browser so that would be a Node.js only feature if it gets implemented. |
This comment has been minimized.
This comment has been minimized.
|
it's quite possible. try this ftp://speedtest.tele2.net/ |
This comment has been minimized.
This comment has been minimized.
|
AFAIK some browsers double as an FTP client but there is no standard way to download FTP files from Javascript. |
This comment has been minimized.
This comment has been minimized.
|
@FluorescentHallucinogen In node it would be possible. It would just need to be implemented. But I don't see why not use HTTP instead. In the browser it is not possible, FTP doesn't have cors and XHR (AJAX) doesn't support it. See this |
This comment has been minimized.
This comment has been minimized.
|
Are there any differences between I know that Does |
This comment has been minimized.
This comment has been minimized.
|
If one of the trackers in the magnet URI e.g. Is it possible to implement in WebTorrent avoiding connecting to a non-secure WebSocket server from a secure origin? |
This comment has been minimized.
This comment has been minimized.
|
@FluorescentHallucinogen There is very little documentation. I found https://wiki.theory.org/BitTorrent_Magnet-URI_Webseeding and https://en.wikipedia.org/wiki/Magnet_URI_scheme#Web_links_to_the_file |
This comment has been minimized.
This comment has been minimized.
|
@FluorescentHallucinogen the issue you described with insecure |
This comment has been minimized.
This comment has been minimized.
Does it mean that it is possible to use For example:
and/or
and/or
Does WebTorrent support using |
This comment has been minimized.
This comment has been minimized.
|
@FluorescentHallucinogen You should use |
This comment has been minimized.
This comment has been minimized.
|
Closing this now, as multi-file web seeds were the last thing we needed to support web seeding fully in WebTorrent, and that is now supported as of this PR (https://github.com/feross/bittorrent-swarm/pull/34). Note that we chose to support BEP19 and not BEP17, since the former is more web-friendly. I haven't seen any torrents that use the BEP17 style. |
This comment has been minimized.
This comment has been minimized.
@feross Do you mean |
This comment has been minimized.
This comment has been minimized.
|
Sorry for the confusion. You should use We don't support specifying the torrent file location in magnet links at the moment, but I recently discovered this spec (https://wiki.theory.org/BitTorrent_Magnet-URI_Webseeding) that explains how to interpret all these parameters correctly. There's a new issue here that will track this feature: #714 |
This comment has been minimized.
This comment has been minimized.
|
I'm looking into supporting WebTorrent at the Internet Archive, and ran into a (minor) missing feature in the support for this. Specifically, it appears that WebTorrent doesn't respect the "name" field in .torrent files, which means it looks in the wrong place when trying to load multi-file webseeds that define the "name" field. https://wiki.theory.org/BitTorrentSpecification#Info_in_Multiple_File_Mode -- definition of the "name" field (edit: After further examination, it looks like WebTorrent does use the name field for looking up webseeds; instant.io and btorrent.xyz just don't display their support for it) |
This comment has been minimized.
This comment has been minimized.
|
@JesseWeinstein It's awesome that you're investigating supporting WebTorrent at The Internet Archive! That's been one of my primary goals in developing WebTorrent from the very beginning! Do let me know if there's any way that I can help. So, about the web seed issue you saw. @dcposch added support for web seeds about a month ago, but it looks like instant.io hasn't been redeployed since then. I just pushed the latest code to it. Let me know if it's working for you now. You might need to run a local copy of Instant.io since the production site uses Strict Transport Security to force HTTPS and that causes HTTP web seeds to fail with Mixed Content. This is a use case that the standards bodies have not considered. A secure HTTPS application that knows what content it is expecting should be allowed to request data over HTTP. |
This comment has been minimized.
This comment has been minimized.
|
Looking at web-seeding - is the https://webtorrent.io using it? The reason I am asking is, on the site's homepage there is a sintel torrent file being downloaded. Now, to test it, I have opened the same site in multiple tabs on the browser. What I was expecting is, that the new tabs will automatically pickup the previous open tabs as (local) seeders for the content - but that did not happen. Every new tab (page instance) tried to hookup for its own peers from outside, essentially downloading multiple copies of the movie from scratch from same peers. Theoritically,
For example, as of now 3 tab instances are downloading bytes 0 to 120MB all 3 times separately (without any knowledge of local peers doing the same thing). What I would love to see is: 3 tabs each divide the remaining job into 3 pieces (0 to 60MB, 61to 90MB, 91 to 120MB etc.) and each connect to entirely different set of peers and finally merge the content locally. If a new tab opens it should reuse the old content from others are they all re-divide their work (based on remaining portion and completion status) Is this kind of thing possible with WebTorrent as of now? |
This comment has been minimized.
This comment has been minimized.
Yes, it is, but everything is downloaded to memory, no persistent chunk store is being used at this moment.
That would depend more on the tracker, but it'd would definitely be nice. I've opened an issue here.
That would require syncing information between the 3 tabs. Although it can be done, it's not on the scope of WebTorrent itself. What should be done is connecting the 3 tabs between each other so they can share the pieces they already have at local-link speed. (This already happens when you are the only peer) |
This comment has been minimized.
This comment has been minimized.
|
@KrishnaPG What @DiegoRBaquero said. Also, web seeds are supported fully now, so we can finally close this issue. |
This comment has been minimized.
This comment has been minimized.
|
Thank you. Just to double confirm, each web-browser instance acts as a potential seed for any new near-by clients, correct? Which means, if 10 people from near-by location connect to one web-site, any new further connections from near-by locations have the chance of picking up the content from one of these previous browser instances (rather than from the server directly) - correct? Kind of browser-based peer-to-peer CDN |
This comment has been minimized.
This comment has been minimized.
|
@KrishnaPG Yes, torrents + web seeds are a form of peer-assisted CDN. But physical proximity (i.e. nearby peers) has nothing to do with how peers discover each other. The tracker server gives out peers randomly, and the client keeps peers that are fast and cooperating. The http server (web seed) is treated as a peer too, albeit a really good one. |
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
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-torrentto recognize HTTP seed servers. It will also require changes tobittorrent-swarm, possiblybittorrent-protocol, andbittorrent-clientif 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: