Comments (3)
I have lots of notes about how the WebRTC part of WebTorrent will work in a notebook with lots of pictures, but I haven't written them up electronically yet. I think it would be awesome to meet up with you in person to be more efficient and figure out the parts that are still not 100% clear. Or maybe IRC on #webtorrent is enough.
I think bittorrent-protocol
can be used as-is on the web. It's browserifiable, transport agnostic, and it has an extension API (that we can expand if necessary) so we can support new message types to make p2p webrtc signaling work.
There may be some way to generalize bittorrent-swarm
and bittorrent-client
so they're more transport agnostic, but it's less obvious how. When I was working on the webtorrent chrome app I wrote chrome-net and chrome-dgram which match the node net
and dgram
APIs exactly but call the underlying chrome.*
APIs under the hood. So they can just be swapped in for the built-in node modules using the browser field in package.json and browserify. I don't think it will be quite so easy -- it's probably impossible -- to write a shim that uses webrtc under the hood since it has such a different model of connecting.
I think that the best we can do is figure out some way to generalize it so more code can be shared and we don't need to write a webtorrent-swarm
and webtorrent-client
module. Though I expect that that will probably be easier to do in the short term, but create more a maintenance burden in the long-run. The two clients might be different enough that it's worth splitting them up.
This is a picture of the dependencies that I made for a presentation.
Stuff in red hasn't been implemented yet. But the webtorrent side is definitely missing some deps that will need to be written.
from webtorrent.
Thanks for the thorough breakdown. I'd love to meet up in person and brainstorm / spec out the remaining design, but I don't expect to be in Cali anytime soon :-/
I agree that it'd be great if we could just swap out webrtc driven versions of net and dgram, but I hear you that it's probably not that straightforward.
I'm particularly concerned about the hybrid webtorrent clients; if we can design a transport-agnostic way of connecting to webrtc-based peers and normal bittorrent peers in a seamless way, I think we'd be well on our way there.
I think some transport abstraction like the one used by discover could work. We could have bittorrent-transport
, bittorrent-transport-node
, and bittorrent-transport-web
. bittorrent-swarm
would need major refactoring to utilize a transport pool and associate a particular type of transport with each peer. bittorrent-dht
, bittorrent-tracker
, and bittorrent-client
would all need to be updated to be transport agnostic as well.
If you think this transport abstraction approach is reasonable, maybe we can come up with a rough draft of what its interface would look like?
from webtorrent.
We have support for WebRTC peers now, so I'm going to close this issue.
from webtorrent.
Related Issues (20)
- High availability of servers HOT 1
- uncaught type error: file appendTo is not a function. HOT 2
- Want to ADD CODE_OF_CONDUCT.md file HOT 3
- import doesn't work from typescript project HOT 1
- Web Socket Connection Fails: Video is loading indefinitely without streaming HOT 2
- Error: write ENOTSUP HOT 1
- Create Navbar for small devices HOT 2
- `add` and `remove` are not async safe HOT 6
- no reasonable clean way to get a timeout on add HOT 1
- Use prettier for easier collaboration HOT 3
- Webtorrent does'nt work for torrents other than the example one. HOT 1
- Prioritize subtitle dowload. HOT 1
- The Docs Need to be UPDATE. HOT 1
- Most urls are broken! HOT 1
- All Torrents stop at exactly 2.8 GB HOT 1
- Webtorrent downloads deselected pieces after re-adding a torrent HOT 5
- Uncaught Error: Can only pipe to one destination HOT 2
- Extend to allow standard websockets HOT 2
- WebTorrent.remove method removes correct torrent and, incorrectly, the last torrent HOT 1
- 🐛 Issue with Next.js: Can't resolve 'dgram' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webtorrent.