Documentation ¶
Index ¶
- func ClientIP(r *http.Request) string
- func GetResponseBodyFormUrl(method, reqUrl, proxyUrl string, customHeader map[string]string, ...) ([]byte, error)
- func HttpProxyClient(rawURL string) *http.Client
- func NewRequestHeaders() requestHeaders
- func QueryStringDecoder4Request(r *http.Request, val any) error
- func QueryStringEncoder(val any) (string, error)
- func RemoteIP(r *http.Request) string
- func SubmitFormData(reqUrl, proxyUrl string, fileFields, formData map[string]string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientIP ¶
ClientIP 尽最大努力实现获取客户端 IP 的算法。 解析 X-Real-IP 和 X-Forwarded-For 以便于反向代理(nginx 或 haproxy)可以正常工作。
func GetResponseBodyFormUrl ¶
func HttpProxyClient ¶
HttpProxyClient local proxy: "http://127.0.0.1:7890"
func NewRequestHeaders ¶ added in v0.2.0
func NewRequestHeaders() requestHeaders
func QueryStringDecoder4Request ¶ added in v0.2.0
func QueryStringEncoder ¶ added in v0.2.6
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.