Documentation
¶
Overview ¶
Package clientip provides client IP helpers. Package clientip 提供客户端 IP 辅助函数。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromRemote ¶
FromRemote parses an IP from remoteAddr. FromRemote 从 remoteAddr 解析 IP。
func FromRequest ¶
FromRequest returns the client IP for r. Call FromRequest(r, Options{TrustedProxies: ...}) when forwarded headers are trusted. FromRequest 返回 r 的客户端 IP。 需要信任转发头时,调用 FromRequest(r, Options{TrustedProxies: ...})。
Example / 示例:
ip, ok := clientip.FromRequest(r, clientip.Options{})
Types ¶
Click to show internal directories.
Click to hide internal directories.