Documentation ¶
Index ¶
- Variables
- func AddIP(ipmatch string, on bool)
- func AddIPs(ipmatchs map[string]bool)
- func AddIpFilter(ipmatch string, whiteIp bool)
- func DeleteIPs(ipmatchs []string)
- func GetBlackList() []string
- func GetLocalExternalIp() (ip string)
- func GetLocalInternalIp() (ip string)
- func GetRemoteAddrIP(remoteAddr string) string
- func GetRemoteIP(con net.Conn) net.IP
- func GetWhiteList() []string
- func IsBlackIp(ipStr string) bool
- func IsTrustedIP(ipStr string) bool
- func IsTrustedIP1(ipStr string) bool
- func IsWhiteIp(ipStr string) bool
- func LoadIpTable(configurl string)
- func ParseFilterIp(ipmatch string) net.IP
- func PrintIpFilte()
- func RequestIP(r *http.Request) string
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetRemoteAddrIP ¶
GetRemoteAddrIP 获取连接的的ip地址(eg:192.168.1.2:1234 -->192.168.1.2)
func LoadIpTable ¶
func LoadIpTable(configurl string)
func RequestIP ¶
RequestIP returns the string form of the original requester's IP address for the given request, taking into account X-Forwarded-For if applicable. If the request was from a loopback address, then we will take the first non-loopback X-Forwarded-For address. This is under the assumption that your golang server is running behind a reverse proxy.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.