aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-02-14 10:46:39 +0100
committerQuentin <quentin@deuxfleurs.fr>2020-02-14 10:46:39 +0100
commitfdffe913974a281ca6ff79389875a2fb29e353b7 (patch)
treec3e95a392d3b6000b9b47f08abaa3d2ae84f8d4d /src
parentf827fd3113a8d5dd267c544251420c87f9a1650a (diff)
downloaddiplonat-fdffe913974a281ca6ff79389875a2fb29e353b7.tar.gz
diplonat-fdffe913974a281ca6ff79389875a2fb29e353b7.zip
consul lib does not work for us, switching to reqwest
Diffstat (limited to 'src')
-rw-r--r--src/main.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs
index 84acca1..7a33bab 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,8 +4,7 @@ use std::net::SocketAddrV4;
use igd::aio::search_gateway;
use igd::PortMappingProtocol;
-use consul::catalog::Catalog;
-use consul::{Client, Config};
+use std::collections::HashMap;
struct DiplonatConfig {
private_ip: String,
@@ -58,13 +57,12 @@ async fn main() {
Err(e) => return println!("unable to build configuration: {}", e),
};
- let consul_config = Config::new().unwrap();
- let consul_client = Client::new(consul_config);
-
- match consul_client.nodes(None) {
- Ok(v) => println!("ok: {:?}", v),
- Err(err) => println!("err: {}", err),
- };
+ let resp = reqwest::get("http://127.0.0.1:5000")
+ .await
+ .unwrap()
+ .json::<HashMap<String, String>>()
+ .await.unwrap();
+ println!("{:#?}", resp);
let gateway = match search_gateway(Default::default()).await {
Ok(g) => g,