proxyutil

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapInProxyProto

func WrapInProxyProto(listener net.Listener, config *ProxyProtoConfig) (net.Listener, error)

WrapInProxyProto wraps the given listener in the PROXY protocol. If behavior is "use_if_authorized" or "deny_if_unauthorized" it also configures a SourceCheck based on the given ProxyProtoConfig. In an error case it returns the original listener and the error.

Types

type ProxyProtoConfig

type ProxyProtoConfig struct {
	sync.RWMutex
	Behavior        string
	AuthorizedAddrs []*sockaddr.SockAddrMarshaler `json:"authorized_addrs"`
}

ProxyProtoConfig contains configuration for the PROXY protocol

func (*ProxyProtoConfig) SetAuthorizedAddrs

func (p *ProxyProtoConfig) SetAuthorizedAddrs(addrs interface{}) error

Jump to

Keyboard shortcuts

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