package
0.0.0-20240912065615-60fd97213283
Repository: https://github.com/go-leo/gox.git
Documentation: pkg.go.dev

# Functions

ClientIP 尽最大努力实现获取客户端 IP 的算法。 解析 X-Real-IP 和 X-Forwarded-For 以便于反向代理(nginx 或 haproxy)可以正常工作。.
ClientPublicIP 尽最大努力实现获取客户端公网 IP 的算法。 解析 X-Real-IP 和 X-Forwarded-For 以便于反向代理(nginx 或 haproxy)可以正常工作。.
ExtractIP extract IP from net.Addr.
ExtractPort extract Port from net.Addr.
GlobalUnicastIP get a global unicast IP address.
GlobalUnicastIPString get a global unicast IP address string.
InterfaceIPs get public IP addresses by interface name.
InterfaceIPv4 get a public IPv4 address.
IP2Long 把net.IP转为数值.
IPs get all IP addresses.
IPString2Long 把ip字符串转为数值.
IsGlobalUnicastIP check whether the IP is a global unicast IP.
IsLocalIP 检测 IP 地址是否是内网地址 通过直接对比ip段范围效率更高.
IsLocalIPAddr 检测 IP 地址字符串是否是内网地址.
Long2IP 把数值转为net.IP.
Long2IPString 把数值转为ip字符串.
PickFreePort automatically chose a free port and return it.
RemoteIP 通过 RemoteAddr 获取 IP 地址, 只是一个快速解析方法。.