Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIPV4 ¶
GetIPV4 get ipv4 string from request. Return "127.0.0.1" if it is loopback. Return empty string if not found.
func GetIPV6 ¶
GetIPV6 get ipv6 string from request. Return "::1" if it is loopback. Return empty string if not found.
func Middleware ¶
func Middleware(config ...Config) *dhttp.Middleware
Middleware to get client IP (in string) from header "X-Forwarded-For" or "X-Real-IP". It will return RemoteAdd if headers not found.
Types ¶
Click to show internal directories.
Click to hide internal directories.