torrust-actix 4.2.15

A rich, fast and efficient Bittorrent Tracker.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::udp::structs::simple_proxy_protocol::SppHeader;
use std::net::SocketAddr;

impl SppHeader {
    /// Returns the real client address carried in the Simple Proxy Protocol header.
    pub fn client_socket_addr(&self) -> SocketAddr {
        SocketAddr::new(self.client_addr, self.client_port)
    }

    /// Returns the proxy address that forwarded the datagram.
    pub fn proxy_socket_addr(&self) -> SocketAddr {
        SocketAddr::new(self.proxy_addr, self.proxy_port)
    }
}