-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support WebTorrent Protocol #223
Comments
+1 |
+1! This would make it possible to have something like popcorntime natively in the browser :D |
Having support for WebTorrent would be huge |
I would also like to reiterate that while having a good swarm of bittorrent, and a good swarm of webtorrent are both really important, libtorrent would be in the critical situation of bridging the two which is critical to the success of webtorrent. |
Huge +1, I think Webtorrent integration is part of the future of Bittorrent; casual swarms and torrent streaming in-browser are killer apps. edit: I always mix up the names for Bitcoin and Bittorrent, sorry! |
+1 |
WebTorrent should be the one to submit a patch with the WebRTC transport implementation. AFAIK they had to change a few things on their side bittorrent-protocol wise to make it work on browsers, who better than them to do this. As of now, there's simply two separate networks, without libtorrent having this transport the WebRTC will never be able to access the seeds on the TCP/UDP side. However, from a practical standpoint, will people keep a browser tab open to seed? possibly creating memleaks on their browser, slowing down their day to day work? or will this just add a massive number of seeds that will ultimately be a huge performance hit for the existing bittorrent network? |
This is hard to say, however with web technologies quickly growing there is no reason why some people wont run their torrents in the background, just like the do with native apps (no tab required). I feel the line between desktop and web is growing thin and not providing features to web apps because they are web apps is becoming an antiquated view point. You may be right, but I suspect that the playing field will change very quickly. |
@arvidn I'm a webtorrent contributor interested in adding support to libtorrent. Do you have any advice on where to start or potential gotchas to be aware of at the outset? |
@fisch0920 My suggestion is start digging |
@kevincox i agree the line between apps and browsers are going thin there is also the issue where webtorrent might negatively impact the swarm by allowing sequential file transfer of media files to be selected the relative ease for media files to be streamed into the video tag of the browser might make it appealing for people to opt for sequential downloads more often that the rarest first and also since lot of people noticed the synergies and obvious usage as this popcorn time in a browser this kind of compounds the facts and might really cause concern on swarm stability |
@fisch0920 aldenml's advice is right btw. the peer_connection is the base class connecting peers to the rest of the bittorrent engine. bt_peer_connection derives from it and implements the bittorrent protocol, there's also web_peer_connection and http_seed_connection for the two kinds of web seeding protocols. deriving from peer_connection to implement a new peer protocol is how it's intended to work. now, I wouldn't be surprised if there will be some rough edges, as its interface has been designed around bt_peer_connection |
Might be possible to use this https://github.com/mozilla/webrtc-standalone for webtorrent support. |
Do you see this in the Makefile?
how many MB is this standalone library? I think a good starting point is find a minimal WebRTC communication stack, or figure out a clear interface to plug inside libtorrent as another protocol. |
@aldenml https://github.com/xhs/librtcdc suggested by @B00tLdr should be a good fit - it's certainly much more lightweight than webrtc-standalone, since librtcdc it implements data channels only, whereas webrtc-standalone implements all the media related functionality of WebRTC too, which isn't necessary for WebTorrent support. |
yes, I saw the link right after I left my comment, thanks |
Just for the record. The receive buffer in peer_connection right now is a complete mess. Mostly because it provides "convenience" functions to advance read pointers and store the current message size being received. Things that are mostly useful for the bittorrent peer, but not really for anyone else. So, if anyone will be looking at integration with webRTC, it would probably make sense to simplify the receive buffer too. |
I'd like to help out with webRTC support, where would be a good place to start? EDIT: Yo @aldenml , I'd like to start working on this. I have Also, I'm familiarizing myself with |
@aldenml Sorry if this pinged you twice, I edited my comment above to ping you, but I'm not sure if github edits will re-ping someone. If there's some other client like IRC or gitter that would be better for possibly bringing me up to speed on this, let me know. |
not a problem (and thanks). I don't have experience with any example in |
@dessalines Thanks working on this! I have dug into your questions. Running
|
I think pulling in If librtcdc itself owns sockets, that might make it difficult (at least if you want to integrate with the main message pump/asio.io_service in libtorrent). It the library let you pass byte in and it passes bytes back out again, it should make it easier to integrate on top of libtorrent peer connections. About the headers, I'm hoping to move towards having only public headers live in include/libtorrent and have private headers live in include/libtorrent/aux_ (and in the libtorrent::aux namespace). Some internal classes do that, but not all yet. |
+1 any progress so far? |
I read the bittorent white paper a long time ago so my knowledge of the protocol is not very deep, so you really triggered my curiosity here. Why would a large number of seeds affect the performance of the network ? And what's the deal with sequential file transfers ? Could you please introduce me to the situation, or give me links me to relevant documentation (whichever is the easiest for you). Many thanks ! |
Even if it weren't for ssl websocket is based on tcp so you can't do hole punching |
The websocket transport is only used to connect to trackers. There you don't need hole punching. For the p2p connection WebRTC takes care of hole punching. |
I recently wrote a light library implementing WebRTC Data Channels in C++ to power another of my projects: https://github.com/paullouisageneau/libdatachannel |
I opened a draft PR with a WebTorrent implementation based on the libdatachannel library: #4123 |
This is absolutely amazing work @paullouisageneau. Really excited to see where this work leads! 😄 |
The great part about this is that @arvidn is actually testing and asking him questions on the draft PR and @paullouisageneau is making the changes based on the queries or suggestions made by arvidn . This means there is a high possibility that after modifications and any cleaning up required, it may get integrated in libtorrent in a future release which furthers clients such as qbittorrent and other apps. which use libtorrent. I, for one am looking for this update, as well as I'm sure others are. |
Thanks @transitive-bullshit ! |
@paullouisageneau I only hope you keep us in the loop. Would all the modifications be back-ported upstream or your or arvidn end up carrying patches ? How do you see it happening ? Edit - I do see that @arvidn seems to have raised lot of queries and provided hints of how some things could be better in src/rtc_stream.cpp . Hope we get it all worked out and imbubed in libtorrent. I did notice arvidn talking about C++17 change and hopefully we see that happening after libtorrent 12 comes out. |
FYI, There is a new C WebRTC implementation from AWS: https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/tree/master/src/source |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It's still work in progress (#4123) so I don't think it should already be closed. |
|
|
@arvidn you can create a new label named "no-stale", or "important" or something like that, and add it to stale bot's |
Judging by the current stale.yml, this should be labeled as Lines 6 to 8 in 9f3192f
|
Is this WIP? |
Yes, this is still WIP. We're getting there! |
Implementation-wise it's finished, it could be merged after reviews and bump to C++17. |
I think this can be closed now #4123 is merged! |
WebTorrent is a new implementation of the bittorrent protocol designed to work over WebRTC. This allows browsers to download torrents without plugins. However, due to the limitations of WebRTC it isn't possible to make the protocol compatible with bittorrent (or uTP).
If libtorrent supported WebTorrent it would be able to communicate with both the existing swarm as well as the browser swarm that is restricted to WebTorrent only.
The text was updated successfully, but these errors were encountered: