johnsonjh / opendnsmyip

opendnsmyip: A Go package to return the public-facing IPv4 address of the client (by querying the Cisco OpenDNS servers)

Home Page:https://github.com/johnsonjh/opendnsmyip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

opendnsmyip

GRC

A Go package that returns the public-facing IPv4 address of the client by querying the Cisco OpenDNS servers.

Original Authors

Credits

This package was inspired by:

License

Usage

package main

import (
        "fmt"

        myip "github.com/johnsonjh/opendnsmyip"
)

func main() {
        myIpAddr, err := myip.GetIP()
        if err != nil {
                fmt.Errorf(
                           "Error getting IPv4 address: %v",
                           err,
                          )
        } else {
                fmt.Printf(
                           "Public IPv4 address is: %s",
                           myIpAddr,
                          )
        }
}
ezoic increase your site revenue

About

opendnsmyip: A Go package to return the public-facing IPv4 address of the client (by querying the Cisco OpenDNS servers)

https://github.com/johnsonjh/opendnsmyip

License:Other


Languages

Language:Go 100.0%