Documentation
¶
Index ¶
- func ClientIP(r *http.Request) string
- func DefaultEndpoint4Protocol(proto string) string
- func DefaultPort4Protocol(proto string) string
- func ForwardedIPs(r *http.Request) []string
- func GetLocalIP() string
- func GetLocalIPv6() string
- func IsIPv6Address(ip net.IP) bool
- func Localhost() string
- func RealIP(r *http.Request) string
- func RemoteIP(r *http.Request) string
- func StartListener(listenAddress string, tlsConfig *tls.Config) (listener net.Listener, listenedIP string, port string, err error)
- func URIs2Hosts(uris []string) ([]string, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEndpoint4Protocol ¶
DefaultEndpoint4Protocol : To ensure consistency, we generate default addr for listenAddress and advertiseAddress by one method. To avoid unnecessary port allocation work, we allocate fixed port for user defined protocol.
func DefaultPort4Protocol ¶
DefaultPort4Protocol returns the default port for different protocols
func ForwardedIPs ¶ added in v1.8.2
ForwardedIPs returns forwarded for ips
func GetLocalIPv6 ¶ added in v1.2.2
func GetLocalIPv6() string
GetLocalIPv6 Get IPv6 address of NIC.
func IsIPv6Address ¶ added in v1.2.2
IsIPv6Address check whether the IP is IPv6 address.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.