MyIP is a small Go application that retrieves information about your public and private IP addresses. It provides the data in either plain text or JSON format.
-json
: Display results in JSON format.-rich
: Display results in rich JSON format with additional information.
- Clone the repository.
- Navigate to the tool's directory.
- Build the tool:
go build myip
- Run the tool:
./myip
- Display public and private IP addresses in plain text:
./myip
- Display results in JSON format:
./myip -json
- Display rich JSON format with additional information:
./myip -json -rich
Public IP : <public_ip>
Private IP : <private_ip>
(Additional information for rich format:
Country : <country>
City : <city>
Region : <region>
Location : <location>
HostName : <hostname>
Organization : <organization>
)
- Plain JSON:
{ "publicIP": "<public_ip>", "privateIP": "<private_ip>" }
- Rich JSON:
{
"public IP": "<public_ip>",
"private IP": "<private_ip>",
"info": {
"ip": "<public_ip>",
"country": "<country>",
"city": "<city>",
"region": "<region>",
"loc": "<location>",
"org": "<organization>",
"hostname": "<hostname>"
}
}