proxyutil

package
Version: v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MPL-2.0 Imports: 7 Imported by: 25

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

Source Files

Jump to

Keyboard shortcuts

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