aboutsummaryrefslogtreecommitdiff
path: root/docker/diplomate/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'docker/diplomate/src/main.rs')
-rw-r--r--docker/diplomate/src/main.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/docker/diplomate/src/main.rs b/docker/diplomate/src/main.rs
index e7a11a9..24d9ec1 100644
--- a/docker/diplomate/src/main.rs
+++ b/docker/diplomate/src/main.rs
@@ -1,3 +1,14 @@
-fn main() {
- println!("Hello, world!");
+use igd::aio::search_gateway;
+#[tokio::main]
+async fn main() {
+ let gateway = match search_gateway(Default::default()).await {
+ Ok(g) => g,
+ Err(err) => return println!("Faild to find IGD: {}", err),
+ };
+
+ let pub_ip = match gateway.get_external_ip().await {
+ Ok(ip) => ip,
+ Err(err) => return println!("Failed to get external IP: {}", err),
+ };
+ println!("Our public IP is {}", pub_ip);
}