Skip to content

Commit 3636859

Browse files
ashu17706claude
andcommitted
fix: replace ifconfig.me with icanhazip.com for reliable IP fallback
Previously, the fallback API (ifconfig.me) would return full HTML content instead of plain text IP addresses, causing the 'Before' and 'After' IP display to show HTML pages. Switch to icanhazip.com which consistently returns plain text IPs. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent d35d040 commit 3636859

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ip.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub fn get_public_ip() -> Result<String> {
66
match get_ip_from_ipify() {
77
Ok(ip) => Ok(ip),
88
Err(_) => {
9-
// Fallback to ifconfig.me
9+
// Fallback to icanhazip.com
1010
get_ip_from_ifconfig()
1111
}
1212
}
@@ -29,11 +29,11 @@ fn get_ip_from_ipify() -> Result<String> {
2929
Ok(ip)
3030
}
3131

32-
/// Get IP from ifconfig.me as fallback
32+
/// Get IP from icanhazip.com as fallback
3333
fn get_ip_from_ifconfig() -> Result<String> {
3434
let client = reqwest::blocking::Client::new();
3535
let response = client
36-
.get("https://ifconfig.me")
36+
.get("https://icanhazip.com")
3737
.timeout(std::time::Duration::from_secs(5))
3838
.send()?;
3939

0 commit comments

Comments
 (0)