File tree Expand file tree Collapse file tree 10 files changed +18
-25
lines changed
Expand file tree Collapse file tree 10 files changed +18
-25
lines changed Original file line number Diff line number Diff line change 33//! This module contains the configuration data structures for the
44//! Torrust Tracker, which is a `BitTorrent` tracker server.
55//!
6- //! The current version for configuration is [`v2 `].
6+ //! The current version for configuration is [`v2_0_0 `].
77pub mod v2_0_0;
88pub mod validator;
99
Original file line number Diff line number Diff line change 3939//! Please refer to the documentation of each structure for more information
4040//! about each section.
4141//!
42- //! - [`Core configuration`](crate::v2 ::Configuration)
43- //! - [`HTTP API configuration`](crate::v2 ::tracker_api::HttpApi)
44- //! - [`HTTP Tracker configuration`](crate::v2 ::http_tracker::HttpTracker)
45- //! - [`UDP Tracker configuration`](crate::v2 ::udp_tracker::UdpTracker)
46- //! - [`Health Check API configuration`](crate::v2 ::health_check_api::HealthCheckApi)
42+ //! - [`Core configuration`](crate::v2_0_0 ::Configuration)
43+ //! - [`HTTP API configuration`](crate::v2_0_0 ::tracker_api::HttpApi)
44+ //! - [`HTTP Tracker configuration`](crate::v2_0_0 ::http_tracker::HttpTracker)
45+ //! - [`UDP Tracker configuration`](crate::v2_0_0 ::udp_tracker::UdpTracker)
46+ //! - [`Health Check API configuration`](crate::v2_0_0 ::health_check_api::HealthCheckApi)
4747//!
4848//! ## Port binding
4949//!
7878//!
7979//! Alternatively, you could setup a reverse proxy like Nginx or Apache to
8080//! handle the SSL/TLS part and forward the requests to the tracker. If you do
81- //! that, you should set [`on_reverse_proxy`](crate::v2 ::network::Network::on_reverse_proxy)
81+ //! that, you should set [`on_reverse_proxy`](crate::v2_0_0 ::network::Network::on_reverse_proxy)
8282//! to `true` in the configuration file. It's out of scope for this
8383//! documentation to explain in detail how to setup a reverse proxy, but the
8484//! configuration file should be something like this:
Original file line number Diff line number Diff line change @@ -185,8 +185,8 @@ impl fmt::Display for Event {
185185/// Depending on the value of this param, the tracker will return a different
186186/// response:
187187///
188- /// - [`Normal`](crate::servers::http:: v1::responses::announce::Normal), i.e. a `non-compact` response.
189- /// - [`Compact`](crate::servers::http:: v1::responses::announce::Compact) response.
188+ /// - [`Normal`](crate::v1::responses::announce::Normal), i.e. a `non-compact` response.
189+ /// - [`Compact`](crate::v1::responses::announce::Compact) response.
190190///
191191/// Refer to [BEP 23. Tracker Returns Compact Peer Lists](https://www.bittorrent.org/beps/bep_0023.html)
192192#[ derive( PartialEq , Debug ) ]
Original file line number Diff line number Diff line change 11//! HTTP requests for the HTTP tracker.
2- //!
3- //! Refer to the generic [HTTP server documentation](crate::servers::http) for
4- //! more information about the HTTP tracker.
52pub mod announce;
63pub mod scrape;
Original file line number Diff line number Diff line change 1- //! `Announce` response for the HTTP tracker [`announce`](bittorrent_http_protocol ::v1::requests::announce::Announce) request.
1+ //! `Announce` response for the HTTP tracker [`announce`](crate ::v1::requests::announce::Announce) request.
22//!
33//! Data structures and logic to build the `announce` response.
44use std:: io:: Write ;
Original file line number Diff line number Diff line change 1- //! `Error` response for the [` HTTP tracker`](crate::servers::http) .
1+ //! `Error` response for the HTTP tracker.
22//!
33//! Data structures and logic to build the error responses.
44//!
@@ -15,7 +15,7 @@ use serde::Serialize;
1515
1616use crate :: v1:: services:: peer_ip_resolver:: PeerIpResolutionError ;
1717
18- /// `Error` response for the [` HTTP tracker`](crate::servers::http) .
18+ /// `Error` response for the HTTP tracker.
1919#[ derive( Serialize , Debug , PartialEq ) ]
2020pub struct Error {
2121 /// Human readable string which explains why the request failed.
Original file line number Diff line number Diff line change 11//! HTTP responses for the HTTP tracker.
2- //!
3- //! Refer to the generic [HTTP server documentation](crate::servers::http) for
4- //! more information about the HTTP tracker.
52pub mod announce;
63pub mod error;
74pub mod scrape;
Original file line number Diff line number Diff line change 1- //! `Scrape` response for the HTTP tracker [`scrape`](bittorrent_http_protocol ::v1::requests::scrape::Scrape) request.
1+ //! `Scrape` response for the HTTP tracker [`scrape`](crate ::v1::requests::scrape::Scrape) request.
22//!
33//! Data structures and logic to build the `scrape` response.
44use std:: borrow:: Cow ;
Original file line number Diff line number Diff line change 5252//! The tracker responds to the peer with the list of other peers in the swarm so that
5353//! the peer can contact them to start downloading pieces of the file from them.
5454//!
55- //! Once you have instantiated the `Tracker ` you can `announce` a new [`peer::Peer`] with:
55+ //! Once you have instantiated the `AnnounceHandler ` you can `announce` a new [`peer::Peer`](torrust_tracker_primitives::peer::Peer) with:
5656//!
5757//! ```rust,no_run
5858//! use std::net::SocketAddr;
8181//! ```
8282//!
8383//! ```text
84- //! let announce_data = tracker .announce(&info_hash, &mut peer, &peer_ip).await;
84+ //! let announce_data = announce_handler .announce(&info_hash, &mut peer, &peer_ip).await;
8585//! ```
8686//!
8787//! The `Tracker` returns the list of peers for the torrent with the infohash `3b245504cf5f11bbdbe1201cea6a6bf45aee1bc0`,
306306//! `c1277613db1d28709b034a017ab2cae4be07ae10` is the torrent infohash and `completed` contains the number of peers
307307//! that have a full version of the torrent data, also known as seeders.
308308//!
309- //! Refer to [`peer`] module for more information about peers.
309+ //! Refer to [`peer`](torrust_tracker_primitives::peer) for more information about peers.
310310//!
311311//! # Configuration
312312//!
Original file line number Diff line number Diff line change 22//!
33//! The service is responsible for handling the `announce` requests.
44//!
5- //! It delegates the `announce` logic to the [`Tracker`](crate::core::Tracker::announce)
6- //! and it returns the [`AnnounceData`] returned
7- //! by the [`Tracker`].
5+ //! It delegates the `announce` logic to the [`AnnounceHandler`] and it returns
6+ //! the [`AnnounceData`].
87//!
98//! It also sends an [`statistics::event::Event`]
109//! because events are specific for the HTTP tracker.
You can’t perform that action at this time.
0 commit comments