use rquest::Client;
#[cfg(any(
target_os = "android",
target_os = "fuchsia",
target_os = "linux",
target_os = "ios",
target_os = "visionos",
target_os = "macos",
target_os = "tvos",
target_os = "watchos"
))]
#[tokio::main]
async fn main() -> Result<(), rquest::Error> {
let client = Client::builder().interface("eth0").build()?;
client.update().interface("eth1").apply()?;
let resp = client.get("https://api.ip.sb/ip").send().await?;
println!("{}", resp.text().await?);
Ok(())
}
#[cfg(not(any(
target_os = "android",
target_os = "fuchsia",
target_os = "linux",
target_os = "ios",
target_os = "visionos",
target_os = "macos",
target_os = "tvos",
target_os = "watchos"
)))]
fn main() {}