# Functions
AuthorityAddr returns a given authority (a host/IP, or host:port / ip:port) and returns a host:port.
No description provided by the author
No description provided by the author
ClientIP 尽最大努力实现获取客户端 IP 的算法。 解析 X-Real-IP 和 X-Forwarded-For 以便于反向代理(nginx 或 haproxy)可以正常工作。.
ClientPublicIP 尽最大努力实现获取客户端公网 IP 的算法。 解析 X-Real-IP 和 X-Forwarded-For 以便于反向代理(nginx 或 haproxy)可以正常工作。.
No description provided by the author
DiscoverDNS ...
GetIP returns request real ip.
No description provided by the author
GetPort returns the port of an endpoint address.
HasLocalIP 检测 IP 地址是否是内网地址 通过直接对比ip段范围效率更高,详见:https://github.com/thinkeridea/go-extend/issues/2.
HasLocalIPAddr 检测 IP 地址字符串是否是内网地址.
HasLocalIPddr 检测 IP 地址字符串是否是内网地址 Deprecated: 此为一个错误名称错误拼写的函数,计划在将来移除,请使用 HasLocalIPAddr 函数.
HostIP tries to return the IPv4 string from the primary network interface.
IP2Long 把net.IP转为数值.
IPString2Long 把ip字符串转为数值.
IsPortUsed 检查端口是否被占用.
No description provided by the author
No description provided by the author
Long2IP 把数值转为net.IP.
Long2IPString 把数值转为ip字符串.
No description provided by the author
NewTCPSocket creates a TCP socket listener with the specified address and the specified tls configuration.
RealIP resolves the real client IP address from the request.
RemoteIp 返回远程客户端的 IP,如 192.168.1.1.
RemoteIP 通过 RemoteAddr 获取 IP 地址, 只是一个快速解析方法。.
WithChmod modifies socket file's access mode.
WithChown modifies the socket file's uid and gid.
No description provided by the author
# Variables
ErrIFNotFound is returned if we can't find an available network interface.
# Type aliases
SockOpt sets up socket file's creating option.