Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( XMLEndpoints = []string{ "/cgi-bin/datalog.xml", "/cgi-bin/outlog.xml", "/cgi-bin/status.xml", } JSONEndpoints = []string{ "/cgi-bin/datalog.json", "/cgi-bin/outlog.json", "/cgi-bin/status.json", } )
Functions ¶
This section is empty.
Types ¶
type AccessList ¶
type AccessList struct {
// contains filtered or unexported fields
}
AccessList represents an IP access list.
func NewAccessList ¶
func NewAccessList(cidr []string, cacheSize int) (*AccessList, error)
NewAccessList creates a new IP access list for given CIDRs. A LRU cache is used when cacheSize is specified to speedup frequently looked up addresses.
func (*AccessList) Contains ¶
func (a *AccessList) Contains(in string) bool
Contains verifies if given IP address is member of any defined access list nets.
type Apex ¶
type Apex struct {
// contains filtered or unexported fields
}
Apex proxy handler.
type ProxyOption ¶
type ProxyOption func(*Apex)
ProxyOption allows configuring the Apex proxy.
func WithAccessListCacheSize ¶
func WithAccessListCacheSize(size int) ProxyOption
WithAccessListCacheSize configures the LRU IP matcher cache size.
func WithAllowIPs ¶
func WithAllowIPs(ips []string) ProxyOption
WithAllowIPs allows requests from given list of IP ranges.
func WithAllowJSONEndpoints ¶
func WithAllowJSONEndpoints() ProxyOption
WithAllowJSONEndpoints allows GET requests for cgi-bin JSON endpoints.
func WithAllowPrivateIPs ¶
func WithAllowPrivateIPs() ProxyOption
WithAllowPrivateIPs allows requests from all private IP ranges.
func WithAllowXMLEndpoints ¶
func WithAllowXMLEndpoints() ProxyOption
WithAllowXMLEndpoints allows GET requests for cgi-bin XML endpoints.
func WithAllowedURLs ¶
func WithAllowedURLs(urls []string) ProxyOption
WithAllowedURLs allows GET requests to given list of URLs.