Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

257
Views
Stitching DHT and Torrent Client together

I have two java libraries. One connects to DHT and can successfully download torrent files. And the other which downloads the actual data associated with the torrent.

The torrent client library expects an announce or announce-list section in the torrent, and does't understand the 'nodes' entry.

The question is how do I alter the torrent client code to understand the 'nodes' section of a torrent file. OR How do I calculate a tracker URL from a set of ip:port DHT peer addresses?

I could just guess the url by guessing a port number and appending /announce onto it.. but this surely isn't right?

Does anyone know how this works?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

For DHT-only operation you do not need an announce URL. If the library itself expects one you can insert a dummy url, the format dht://<infohash in hex> is common, but it does not matter, as it won't be used.

The DHT part on the other hand does not require the nodes to perform a lookup, it simply operates based on the infohash of the torrent. The nodes can optionally be injected into a dht client for bootstrapping, e.g. by executing a ping on them, but that should not be needed if it already is bootstrapped. Once the DHT client has done its get_peers and announce lookups the peer lists can be injected back into the torrent client.

Since you're using my library: You can use PeerLookupTask to read a torrent peer list from the DHT and AnnounceTask to add your torrent port to the list. The obtained IP and Ports have to be passed to the torrent client. The GetPeers CLI command contains an example how to use the first part. There also are utility methods that should cover common use cases.

over 4 years ago · Santiago Trujillo Report

0

For an alternative I may recommend you to see Bt, which is a Java 8 BitTorrent client and already integrates with the8472's mldht: https://github.com/atomashpolskiy/bt

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!