Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultEchoIpV4Server = "https://ipv4.ip.openspa.org"
View Source
const DefaultEchoIpV6Server = "https://ipv6.ip.openspa.org"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EchoIPPublicResolver ¶
type EchoIPPublicResolver struct { }
Echo-IP public resolver: https://github.com/greenstatic/echo-ip
func (EchoIPPublicResolver) GetPublicIP ¶
func (_ EchoIPPublicResolver) GetPublicIP(resolverUrl string) (ip net.IP, proxyIP net.IP, err error)
Returns the client's public IP with which they sent a HTTP POST request to a Echo-IP service. We send a HTTP POST request in case GET requests are cached. The resolverUrl string expects the URL of the Echo-IP resolver, this can be a http/https URL.
type OutboundDummySocketResolver ¶
type OutboundDummySocketResolver struct { }
func (*OutboundDummySocketResolver) GetIPv4OutboundIP ¶
func (outbound *OutboundDummySocketResolver) GetIPv4OutboundIP() (net.IP, error)
func (*OutboundDummySocketResolver) GetIPv6OutboundIP ¶
func (outbound *OutboundDummySocketResolver) GetIPv6OutboundIP() (net.IP, error)
type OutboundResolver ¶
type PublicResolver ¶
Resolves the client's public IP by returning the public IP used by the client and the last proxy IP (in case any are in use).
type ResolveResponse ¶
type ResolveResponse struct { OutboundIPv4 net.IP OutboundIPv6 net.IP PublicIPv4 net.IP ProxyIPv4 net.IP NatIPv4 bool PublicIPv6 net.IP ProxyIPv6 net.IP NatIPv6 bool NoIPv4Outbound bool NoIPv4Public bool NoIPv6Outbound bool NoIPv6Public bool }
func Resolve ¶
func Resolve(echoIPServerIPv4, echoIPServerIPv6 string) (ResolveResponse, error)
Returns various network related IP addresses.
Click to show internal directories.
Click to hide internal directories.