IP Revealer is a simple Rust program that displays both the external (WAN) IP address and the local IP address of the machine it's running on. It now supports command-line options for more flexible usage.
- Fetches and displays the external (WAN) IP address
- Retrieves and shows the local IP address
- Supports command-line options for selective display of IP addresses
- Offers a raw output mode for easy integration with other tools
- Simple and easy to use
To use IP Revealer, you need to have Rust and Cargo installed on your system. If you don't have them installed, you can get them from rustup.rs.
Once you have Rust and Cargo, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/ip_revealer.git cd ip_revealer -
Build the project:
cargo build --release
After building the project, you can run IP Revealer using:
cargo run --release -- [OPTIONS]
Or, you can run the compiled binary directly:
./target/release/ip_revealer [OPTIONS]
--wan: Display only the WAN (external) IP address--local: Display only the local IP address--raw: Display the IP address(es) without labels
Note: --wan and --local are mutually exclusive. If neither is specified, both IP addresses will be displayed.
-
Display both IP addresses (default behavior):
ip_revealerOutput:
External (WAN) IP: 203.0.113.1 Local IP: 192.168.1.2 -
Display only the WAN IP:
ip_revealer --wanOutput:
External (WAN) IP: 203.0.113.1 -
Display only the local IP:
ip_revealer --localOutput:
Local IP: 192.168.1.2 -
Display the WAN IP in raw format (useful for scripting):
ip_revealer --wan --rawOutput:
203.0.113.1 -
Pipe the raw WAN IP to another command (e.g., copying to clipboard on macOS):
ip_revealer --wan --raw | pbcopy
IP Revealer uses the following crates:
clap: For parsing command-line argumentsreqwest: For making HTTP requests to fetch the external IPlocal_ip_address: For retrieving the local IP address
This project is licensed under the MIT License - see the LICENSE file for details.