Skip to content

Commit

Permalink
ureq instead of reqwest
Browse files Browse the repository at this point in the history
  • Loading branch information
psidex committed Jul 25, 2023
1 parent b483024 commit 48df1b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
reqwest = { version = "0.11", features = ["blocking"] }
ureq = "2.7"
log = "0.4"
simple_logger = "4.2"
actix-web = "4.3"
Expand Down
5 changes: 3 additions & 2 deletions src/bin/ipmon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ const IP_CACHE_PATH: &str = "./ipmon.cache";
fn get_current_ipv4(server_url: &str) -> Result<Ipv4Addr, Box<dyn Error>> {
let ip = match platform::is_debug() {
true => Ipv4Addr::from_str("127.0.0.1")?,
false => reqwest::blocking::get(server_url)?
.text()?
false => ureq::get(server_url)
.call()?
.into_string()?
.parse::<Ipv4Addr>()?,
};
Ok(ip)
Expand Down

0 comments on commit 48df1b3

Please sign in to comment.