request

package
v1.0.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIp

func ClientIp(r *http.Request) string

ClientIp 尽最大努力实现获取客户端 IP 的算法。 解析 X-Real-IP 和 X-Forwarded-For 以便于反向代理(nginx 或 haproxy)可以正常工作。

func ExternalIp added in v1.0.31

func ExternalIp() (string, error)

func GetRandomUserAgent

func GetRandomUserAgent() string

GetRandomUserAgent 获取用户UA

func GetRandomUserAgentMobile added in v1.0.31

func GetRandomUserAgentMobile() string

GetRandomUserAgentMobile 获取用户UA

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL