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 upBring torrents to the browser (chrome extension) #443
Comments
This comment has been minimized.
This comment has been minimized.
|
Does anyone think this is a good idea, is realistic and/or has any value to this project? |
This comment has been minimized.
This comment has been minimized.
|
I think it is an great ideia! Altought I think we would need some ideias to share the extensions to another users, I mean, why they would change from their current clients to another one? Also, two another good ideias I've to solve the gap: This second ideia, I started a project a few months ago, and it's working fine, for my tests. |
This comment has been minimized.
This comment has been minimized.
|
https://github.com/feross/chrome-net relevant? |
This comment has been minimized.
This comment has been minimized.
|
+1 for this idea! |
This comment has been minimized.
This comment has been minimized.
|
We made a working chrome extension for webtorrent for a hackathon, it worked pretty well https://github.com/RosettaLabs/Torrentula (webRTC only). Something changed with the chrome api and local storage and it doesn't run anymore, should be a fairly easy fix though if you guys want to fork it or canabalize it. It has a fully functional add/delete/view torrent manager built in react with a flux architecture. |
This comment has been minimized.
This comment has been minimized.
|
That's interesting. I think the great thing about using a chrome app for this, though, would be access to the primary bittorrent network. |
This comment has been minimized.
This comment has been minimized.
|
Thank you for the comments, I'm currently trying to figure out how exactly everything is working. My current questions:
Also I found this project: |
This comment has been minimized.
This comment has been minimized.
No, there is no difference, the issue is that webtorrent (in browser) is limited to webRTC, and other clients haven't implemented that connection method
There are two methods of finding peers, a tracker, or a DHT (Distributed Hash Table). You can lookup how either work
I am still not exactly sure about how it is stored in browser. It might be in memory if you download it. This is used, https://github.com/mafintosh/memory-chunk-store but I don't think it does local storage or anything. |
This comment has been minimized.
This comment has been minimized.
|
Check out https://github.com/feross/webtorrent-hybrid for a bridge between BitTorrent/BitTorrent over WebRTC. |
This comment has been minimized.
This comment has been minimized.
|
webtorrent-hybrid is just webtorrent with a native wtrc module. Since chrome apps can already do wrtc, I think just I think building webtorrent with browserify, substituting chrome-net for net, might work. Somebody should try it. |
This comment has been minimized.
This comment has been minimized.
|
@devtristan I think you are mistaken about webtorrent-hybrid, it connects to both webrtc and TCP/UDP peers. Webtorrent (non-hybrid) is only for webrtc in the browser, and IIRC only tcp/udp in node. So you need to use webtorrent hybrid for both. Webtorrent will only do one, or the other, depending on the enviornment. |
This comment has been minimized.
This comment has been minimized.
|
Right, sorry, that's what I meant. See the source code: https://github.com/feross/webtorrent-hybrid/blob/master/index.js I'm not sure how webtorrent decides to connect to the main bittorrent network or not, but I don't see a reason why it wouldn't be able to, and bittorrent-hybrid wouldn't work due to the native module. |
This comment has been minimized.
This comment has been minimized.
|
Looks like |
This comment has been minimized.
This comment has been minimized.
|
Great idea! +1 |
This comment has been minimized.
This comment has been minimized.
|
+1 It uses bittorrent in a chrome extension. It can stream torrents and its also seekable witch is grate! (think the CPU went up when i tried) |
This comment has been minimized.
This comment has been minimized.
|
I managed to get this working a while ago. It's an MVP but it runs. https://gist.github.com/devTristan/b768d2ee571350d5b796 The hard part was aliasing all of the node-only modules and overriding browser excludes. It was pretty easy to find chrome-compatible modules to polyfill things like What works:
What doesn't work:
I don't know why it crashes. I suspect it's something to do with trying to allocate too much in the way of resources - memory, disk space, network connections, etc. When I do profiling, it looks like the JS-Native bridge is the bottleneck with all of the network api calls, but I could be wrong. You should be able to clone my gist and try it out yourself. Happy hacking. |
This comment has been minimized.
This comment has been minimized.
|
I'm having the same issue with everything working fine for a couple minutes then getting bogged down. I can slowly watch the CPU utilization tick up as well as the Packets in/out. My guess is it's slowly duplicating processes but I can't figure out why. This is my background script... https://github.com/loon3/Tokenly-Pockets/blob/master/Chrome%20Extension/js/webtorrent/bvam-seed.js |
This comment has been minimized.
This comment has been minimized.
|
Hi @devtristan !, I try to run your extension, but i can makes work. I put the bundle.js (not include in your package at same of app.css) ignore the app.css and put a Magnet for test and the code retrieve the follows erros: Failed to load resource: net::ERR_FILE_NOT_FOUND |
This comment has been minimized.
This comment has been minimized.
|
Hey @eliooses, did you use the I think all of those warnings are fine, but the If that doesn't help, try throwing it all in a github repo and I'll clone it and try it out. |
This comment has been minimized.
This comment has been minimized.
|
This idea - torrent client as a Chrome extension - was actually one of the first things I did when starting to play with webtorrent. It was very easy to get working. If anyone's interested in the code, I can upload everything I have as-is to a repository. |
This comment has been minimized.
This comment has been minimized.
|
@aqwsez blank repo!!! |
This comment has been minimized.
This comment has been minimized.
|
Is anyone still working on something here? I would like to contribute. Would be awesome to be able to download regular torrents from the browser and seed them on webtorrent |
This comment has been minimized.
This comment has been minimized.
|
FYI:
https://blog.chromium.org/2016/08/from-chrome-apps-to-web.html |
This comment has been minimized.
This comment has been minimized.
|
To bring this back alive, something I'd like to add. Building support for the Chrome UDP Sockets API in WebTorrent should also allow us to build WebTorrent support in Android apps via Google's sockets.udp Cordova plugin https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-udp and even though Google is dropping support for Chrome Apps on Windows, Mac and Linux, I'd argue that Chrome OS support is still important considering that the userbase on that end keeps growing. Also, a question, how viable would it be to build this extension using the Chrome Native Messaging API? I'm thinking it might be a good idea to just have a Chrome extension silently open the WebTorrent Desktop app and start downloading the torrent (with some sort of permission prompt first for security reasons of course) and then have it seed to the web page via WebRTC. I'm no expert, but it shouldn't be too hard to build this 2nd option, shoot I'll gladly build this myself. I just need to know if this would work. |
This comment has been minimized.
This comment has been minimized.
|
I'm a bit late to the party here, but it would be nice to have the extension also give sites using the WebTorrent API the ability to use the raw sockets provided by browser extensions (it seems to currently only be supported by Chrome, but there is a proposal to add it to the WebExtensions spec). This would allow WebTorrent clients to be able to access the entirety of the BitTorrent network without clients supporting WebRTC needing to be available. I'm not entirely sure how the client <-> extension communication would work, but I imagine there are a number of ways of going about it. One possible way is to somewhat replicate how the Vue DevTools extension does it; it adds a property to the window which is essentially an EventEmitter bridge between the extension and client script. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
FWIW, I think a WebTorrent Chrome App is a great idea for Chrome OS users. I think that it won't help Mac, Windows, and Linux users much since Chrome Apps are deprecated and support will eventually be removed. Unfortunately, the For that reason, I personally don't consider making a Chrome App to be a top priority but if someone wants to take a stab at making one, go for it. |

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:
-> starts direct download
-> seeds to webtorrent network
-> is asked to install extension
-> starts to download
-> seeds to webtorrent network (&bittorrent)