Documentation
¶
Index ¶
- func ConnContext(ctx context.Context, c net.Conn) context.Context
- func DirectClientIP(r *http.Request) (ip net.IP)
- func DirectClientTLS(r *http.Request) bool
- func ForwardedClientTLS(r *http.Request) bool
- func ForwardedRealIP(r *http.Request) net.IP
- func GetConn(ctx context.Context) (net.Conn, bool)
- type ClientIP
- type ClientTLS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirectClientIP ¶
DirectClientIP assumes that there is no intermediate proxy between the ls3 server and the client. It takes the remote IP from the connection. Requires that the HTTP server was set with ConnContext.
func DirectClientTLS ¶
DirectClientTLS returns true if the given HTTP request has a valid TLS connection state.
func ForwardedClientTLS ¶
ForwardedClientTLS returns true if the first X-Forwarded-Proto HTTP header is `https`. It returns false if the header is missing or is any other value.
func ForwardedRealIP ¶
ForwardedRealIP takes the value of the X-Real-Ip header from the HTTP request. If the header is missing or does not contain a valid IP then DirectClientIP is used instead.
Types ¶
Click to show internal directories.
Click to hide internal directories.