proxies

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SO_ORIGINAL_DST = 80
)

Variables

This section is empty.

Functions

func CaCertSetup added in v0.2.1

func CaCertSetup() (caCert *x509.Certificate, caPrivateKey *rsa.PrivateKey, err error)

func CopyDataOriginalDestination added in v0.2.1

func CopyDataOriginalDestination(ctx context.Context, waitgroup *sync.WaitGroup, toOriginal chan Data, sockets *SocketMap, toDestination *DataMap)

func DtlsConfigSetup added in v0.2.1

func DtlsConfigSetup(caCert *x509.Certificate, caPrivateKey *rsa.PrivateKey) (config *dtls.Config, err error)

func ListenTcp added in v0.2.1

func ListenTcp(ctx context.Context, waitgroup *sync.WaitGroup, ipAddress, port string, toOriginal chan Data, sockets *SocketMap, toDestination *DataMap, tlsConfig *tls.Config) (err error)

func ListenUdp added in v0.2.1

func ListenUdp(ctx context.Context, waitgroup *sync.WaitGroup, ipAddress, port string, toOriginal chan Data, sockets *SocketMap, toDestination *DataMap, dtlsConfig *dtls.Config) (err error)

func Setup added in v0.2.1

func Setup() (toOriginal chan Data, sockets SocketMap, toDestination DataMap, tlsConfig *tls.Config, dtlsConfig *dtls.Config, err error)

func TlsConfigSetup added in v0.2.1

func TlsConfigSetup(caCert *x509.Certificate, caPrivateKey *rsa.PrivateKey) (config *tls.Config, err error)

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func New added in v0.2.1

func New(rawConnection net.Conn) (connection *Conn)

func (*Conn) Close

func (connection *Conn) Close() (err error)

func (*Conn) LocalAddr

func (connection *Conn) LocalAddr() (address net.Addr)

func (*Conn) Read

func (connection *Conn) Read(buffer []byte) (length int, err error)

func (*Conn) RemoteAddr

func (connection *Conn) RemoteAddr() (address net.Addr)

func (*Conn) SetDeadline

func (connection *Conn) SetDeadline(time time.Time) (err error)

func (*Conn) SetReadDeadline

func (connection *Conn) SetReadDeadline(time time.Time) (err error)

func (*Conn) SetWriteDeadline

func (connection *Conn) SetWriteDeadline(time time.Time) (err error)

func (*Conn) Write

func (connection *Conn) Write(buffer []byte) (length int, err error)

type Data

type Data struct {
	IPTuple *logging.IPTuple
	Data    []byte
	TLS     bool
}

type DataMap added in v0.2.1

type DataMap struct {
	Map  map[*logging.IPTuple][]byte
	Lock *sync.RWMutex
}

type Socket

type Socket struct {
	Connection net.Conn
	Lock       *sync.RWMutex
	TLS        bool
}

type SocketMap added in v0.2.1

type SocketMap struct {
	Map  map[*logging.IPTuple]*Socket
	Lock *sync.RWMutex
}

Jump to

Keyboard shortcuts

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