diplonat/src/gw.rs

14 lines
319 B
Rust
Raw Normal View History

2020-05-09 14:27:54 +00:00
use igd::aio::Gateway;
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);
}