Comments (12)
https://github.com/jech/dht is a legit implementation used by Transmission, but it's 3000 lines of C and doesn't look easy to port.
from webtorrent.
Also useful:
from webtorrent.
here is a ready to use node module https://github.com/indutny/dht.js
from webtorrent.
Another one https://github.com/deoxxa/bittorrent-dht-byo
Also interesting: https://github.com/tristanls/k-bucket and https://github.com/tristanls/discover
from webtorrent.
Can't we just use one of them? Maybe extend kademlia?
from webtorrent.
Yeah, will consider dht.js. Seems legit.
from webtorrent.
👍
from webtorrent.
I just updated bittorrent-dht to 1.0.0. It now follows the spec, contains a proper routing table, answers find_node requests from other nodes, and more efficiently crawls the DHT.
Previously, to find peers we would do a very aggressive crawl where we stuck every new node into a big queue and queried them all, not paying any attention to how close they were to the target info hash. So we had lots of pointless traffic to far away nodes that weren't helping us at all. Now, we only recurse on the K closest nodes, so we find the correct nodes with a lot less UDP traffic.
I'm really happy with the new API. Check it out: https://github.com/feross/bittorrent-dht
from webtorrent.
Nice! Is the idea for bittorrent-dht to one day work over WebRTC as well, i.e. have an exchangeable networking module, or will that be a different project?
from webtorrent.
@jure I would definitely prefer to utilize the work that's already gone into bittorrent-dht
when writing the WebRTC version. bittorrent-dht
is quite fast, reliable, and well-tested. And also used by the peerflix/torrent-stream projects. So it's going to keep getting better over time.
Perhaps the parts of the module that use dgram
can be abstracted out so the majority of the code could be re-used?
from webtorrent.
I see, bittorrent-dht is made specifically to work in Node and with the existing bittorrent network. Just a bit of background: what I'm looking for is not a protocol specific (i.e. bittorrent) DHT implementation, but a general DHT implementation (Chord/Kademlia) in the browser, backed by WebRTC (not UDP). There are a few attempts out there but for some reason all of them are somewhere in the alpha-stage zone.
I know this is very off topic, but if you were to start writing a WebRTC DHT framework, where would you begin?
from webtorrent.
I know this is very off topic, but if you were to start writing a WebRTC DHT framework, where would you begin?
Write it transport agnostic, in Node.js, but only with APIs available
on the browser (in Node.js would be acceptable to use modules that
implement this APIs).
As a personal side-note, I'm thinking about to fork Chord.js and
remove the dependency of PeerJS, this would be a good starting point.
"Si quieres viajar alrededor del mundo y ser invitado a hablar en un
monton de sitios diferentes, simplemente escribe un sistema operativo
Unix."
– Linus Tordvals, creador del sistema operativo Linux
from webtorrent.
Related Issues (20)
- 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 4
- Hi, I have built a collaborative video editor with webtorrent support HOT 1
- Introduction example is broken on https://webtorrent.io/intro HOT 4
- Do not use the old `import ... assert` syntax. HOT 1
- failed to build in Electron with utp-native error HOT 5
- autoStart option for client.add HOT 4
- client.seed() doesn't start unless client is restarted HOT 3
- wrong Return Value type of client.get() in @types/webtorrent packages HOT 1
- Update Flatpak version HOT 1
- Version 2.2.1 requires webrtc-polyfill due to loose dependency on torrent-discovery HOT 4
- Filename is overridden by the torrent name when seeding a single file HOT 1
- Already downloaded files are not showing inside torrent.files array HOT 2
- Cannot find module "node_datachannel.node" HOT 1
- Syntax error on webtorrent-min.js for multiple version HOT 5
- TypeError: Cannot read properties of null (reading 'isIP') HOT 6
- de-duplicate IP packages
- Publish on Flathub HOT 1
- Metadata is forgotten on page reload HOT 3
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.