server

package
v0.0.0-...-1cb6917 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Engine = gin.Default()

Engine GIN

Functions

func RemoteIP

func RemoteIP(req *http.Request) (remote string)

RemoteIP implements a best effort algorithm to return the real client IP, it parses X-BACKEND-BILI-REAL-IP or X-Real-IP or X-Forwarded-For in order to work properly with reverse-proxies such us: nginx or haproxy. Use X-Forwarded-For before X-Real-Ip as nginx uses X-Real-Ip with the proxy's IP. 所有的客户端请求必须设置请求头用以获取真实的 ip 地址

Types

This section is empty.

Jump to

Keyboard shortcuts

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