📚 publicip - Awesome Go Library for Networking

Package publicip returns your public facing IPv4 address (internet egress)
🏷️ Networking
📂 Networking
⭐ 0 stars
Detailed Description of publicip
#publicip
This package returns the public facing IP address of the calling client (a la https://icanhazip.com, but from Go!)
Author
James Polera [email protected]
Dependencies
publicip uses Glide for dependency management. After cloning this package, run:
glide up
Credits
This package was inspired by both:
Example
package main
import (
"fmt"
"github.com/polera/publicip"
)
func main() {
myIpAddr, err := publicip.GetIP()
if err != nil {
fmt.Printf("Error getting IP address: %s\n", err)
} else {
fmt.Printf("Public IP address is: %s", myIpAddr)
}
}