async fn print_external_address() {
    let response = Client::new()
        .get(Uri::from_static("http://ipinfo.io/ip"))
        .await
        .expect("Request for external IP failed.");
    if response.status() == StatusCode::OK {
        let mut buf = String::new();
        body::aggregate(response)
            .await
            .expect("Request for external IP couldn't be parsed.")
            .reader()
            .read_to_string(&mut buf)
            .unwrap();
        if let Ok(uri) = Uri::from_str(&buf) {
            println!("External link: http://{}:{}/", uri, CONFIG.port);
        } else {
            println!("Unable to determine external IP.");
        }
    } else {
        println!("Unable to determine external IP.");
    }
}
// Retrieves and prints the IP address that others can use to connect to the server.
Retrieves and prints the IP address that others can use to connect to the server.
Retrieves and prints the IP address that others can use to connect to the server .
async fn print_external_address() {
    let response = Client::new()
        .get(Uri::from_static("http://ipinfo.io/ip"))
        .await
        .expect("Request for external IP failed.");
    if response.status() == StatusCode::OK {
        let mut buf = String::new();
        body::aggregate(response)
            .await
            .expect("Request for external IP couldn't be parsed.")
            .reader()
            .read_to_string(&mut buf)
            .unwrap();
        if let Ok(uri) = Uri::from_str(&buf) {
            println!("External link: http://{}:{}/", uri, CONFIG.port);
        } else {
            println!("Unable to determine external IP.");
        }
    } else {
        println!("Unable to determine external IP.");
    }
}
async fn print_external_address ( ) { let response = Client :: new ( ) . get ( Uri :: from_static ( " " ) ) . await . expect ( " " ) ; if response . status ( ) == StatusCode :: OK { let mut buf = String :: new ( ) ; body :: aggregate ( response ) . await . expect ( " " ) . reader ( ) . read_to_string ( & mut buf ) . unwrap ( ) ; if let Ok ( uri ) = Uri :: from_str ( & buf ) { println ! ( " " uri CONFIG port ) ; } else { println ! ( " " ) ; } } else { println ! ( " " ) ; } }
Retrieves and prints the IP address that others can use to connect to the server.
Retrieves and prints the IP address that others can use to connect to the server .