diplonat/src/gw.rs

13 lines
296 B
Rust

use igd::aio::search_gateway;
use anyhow::{Result, Context};
use log::*;
pub async fn get_gateway() -> Result<igd::aio::Gateway> {
let gw = search_gateway(Default::default())
.await
.context("Failed to find gateway")?;
info!("Gateway: {}", gw);
return Ok(gw);
}