rp

package
v0.0.0-...-53ca941 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisableLogging bool

DisableLogging set up logging. default is false (logging)

View Source
var TrustedHeaderField string

TrustedHeaderField is a header field that developer trusted in their env. e.g. Upstream proxy server's special header that only server can setup need to avoid use common forgry-able header fields.

Functions

func CIDR

func CIDR(CIDRs string) gin.HandlerFunc

CIDR is a middleware that check given CIDR rules and return 403 Forbidden when user is not coming from allowed source. CIDRs accepts a list of CIDRs, separated by comma. (e.g. 127.0.0.1/32, ::1/128 )

func IPv4InChina

func IPv4InChina(ipv4 net.IP) bool

func IPv4InLan

func IPv4InLan(ip net.IP) bool

func InChina

func InChina(ip string) bool

InChina returns true if the given IP is in China

func InLan

func InLan(ip string) bool

func Init

func Init(addr string) error

func LoadChinaIPList

func LoadChinaIPList() error

LoadChinaIPList loads china IP list from file

func Start

func Start(addr string, limit string)

func StartDaemon

func StartDaemon(addr string, limit string)

func Stop

func Stop()

func UserHomeDir

func UserHomeDir() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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