Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Torrust Tracker Client

A collection of console clients to make requests to BitTorrent trackers.

Disclaimer: This project is actively under development. We’re currently extracting and refining common functionality from theTorrust Tracker to make it available to the BitTorrent community in Rust. While these tools are functional, they are not yet ready for use in production or third-party projects.

There are currently three console clients available:

  • UDP Client
  • HTTP Client
  • Tracker Checker

Notice: Console apps are planned to be merge into a single tracker client in the short-term.

UDP Client

Announce request:

cargo run --bin udp_tracker_client announce udp://127.0.0.1:6969 9c38422213e30bff212b30c360d26f9a02136422 | jq

Announce response:

{
  "AnnounceIpv4": {
    "transaction_id": -888840697,
    "announce_interval": 120,
    "leechers": 0,
    "seeders": 1,
    "peers": []
  }
}

Scrape request:

cargo run --bin udp_tracker_client scrape udp://127.0.0.1:6969 9c38422213e30bff212b30c360d26f9a02136422 | jq

Scrape response:

{
  "Scrape": {
    "transaction_id": -888840697,
    "torrent_stats": [
      {
        "seeders": 1,
        "completed": 0,
        "leechers": 0
      }
    ]
  }
}

HTTP Client

Announce request:

cargo run --bin http_tracker_client announce http://127.0.0.1:7070 9c38422213e30bff212b30c360d26f9a02136422 | jq

Announce response:

{
  "complete": 1,
  "incomplete": 0,
  "interval": 120,
  "min interval": 120,
  "peers": []
}

Scrape request:

 cargo run --bin http_tracker_client scrape http://127.0.0.1:7070 9c38422213e30bff212b30c360d26f9a02136422 | jq

Scrape response:

{
  "9c38422213e30bff212b30c360d26f9a02136422": {
    "complete": 1,
    "downloaded": 1,
    "incomplete": 0
  }
}

Tracker Checker

The Tracker Checker is a tool to check the health of a list of trackers.

TORRUST_CHECKER_CONFIG='{
     "udp_trackers": ["127.0.0.1:6969"],
     "http_trackers": ["http://127.0.0.1:7070"],
     "health_checks": ["http://127.0.0.1:1212/api/health_check"]
 }' cargo run --bin tracker_checker

Output:

[
  {
    "Udp": {
      "Ok": {
        "remote_addr": "127.0.0.1:6969",
        "results": [
          [
            "Setup",
            {
              "Ok": null
            }
          ],
          [
            "Connect",
            {
              "Ok": null
            }
          ],
          [
            "Announce",
            {
              "Ok": null
            }
          ],
          [
            "Scrape",
            {
              "Ok": null
            }
          ]
        ]
      }
    }
  },
  {
    "Health": {
      "Ok": {
        "url": "http://127.0.0.1:1212/api/health_check",
        "result": {
          "Ok": "200 OK"
        }
      }
    }
  },
  {
    "Http": {
      "Ok": {
        "url": "http://127.0.0.1:7070/",
        "results": [
          [
            "Announce",
            {
              "Ok": null
            }
          ],
          [
            "Scrape",
            {
              "Ok": null
            }
          ]
        ]
      }
    }
  }
]

License

Copyright (c) 2024 The Torrust Developers.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Some files include explicit copyright notices and/or license notices.

Legacy Exception

For prosperity, versions of Torrust BitTorrent Tracker Client that are older than five years are automatically granted the MIT-0 license in addition to the existing LGPL-3.0-only license.