Documentation
¶
Index ¶
- Constants
- func ConnectRealIPInterceptorV2(trustedProxyCIDRs []string) (connectv2.ServerInterceptor, error)
- func ConnectRealIPUnaryInterceptor(trustedProxyCIDRs []string) (connect.UnaryInterceptorFunc, error)
- func ConnectTrustedRequestIPInterceptorV2(header string) connectv2.ServerInterceptor
- func ConnectTrustedRequestIPUnaryInterceptor(header string) connect.UnaryInterceptorFunc
- func FromContext(ctx context.Context) net.IP
- type ClientIP
Constants ¶
View Source
const ( XRealIP = "X-Real-IP" XForwardedFor = "X-Forwarded-For" TrueClientIP = "True-Client-Ip" )
Variables ¶
This section is empty.
Functions ¶
func ConnectRealIPInterceptorV2 ¶ added in v0.30.0
func ConnectRealIPInterceptorV2(trustedProxyCIDRs []string) (connectv2.ServerInterceptor, error)
ConnectRealIPInterceptorV2 is ConnectRealIPUnaryInterceptor for connect-go v2 servers.
func ConnectRealIPUnaryInterceptor ¶
func ConnectRealIPUnaryInterceptor(trustedProxyCIDRs []string) (connect.UnaryInterceptorFunc, error)
ConnectRealIPUnaryInterceptor resolves the client IP from the socket peer and, only when that peer is trusted, X-Forwarded-For.
func ConnectTrustedRequestIPInterceptorV2 ¶ added in v0.30.0
func ConnectTrustedRequestIPInterceptorV2(header string) connectv2.ServerInterceptor
ConnectTrustedRequestIPInterceptorV2 is ConnectTrustedRequestIPUnaryInterceptor for connect-go v2 servers. It must not be installed on a public listener.
func ConnectTrustedRequestIPUnaryInterceptor ¶ added in v0.27.0
func ConnectTrustedRequestIPUnaryInterceptor(header string) connect.UnaryInterceptorFunc
ConnectTrustedRequestIPUnaryInterceptor accepts a single propagated IP from an in-process transport. It must not be installed on a public listener.
Types ¶
Click to show internal directories.
Click to hide internal directories.