tcpproxy

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: MIT Imports: 3 Imported by: 2

README

tcpproxy

golangci-lint

Go TCP proxy. Wrapper arround https://github.com/inetaf/tcpproxy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	Proxy     *tcpproxy.Proxy
	DialProxy *tcpproxy.DialProxy
	// contains filtered or unexported fields
}

Proxy is a TCP proxy. Wrapper arround https://github.com/inetaf/tcpproxy

func New

func New(listenAddr string, toAddr string) *Proxy

New creates a new proxy instance.

func NewUnusedAddr

func NewUnusedAddr(listenHost string, toAddr string) (*Proxy, error)

NewUnusedAddr creates a new proxy instance on a unused random port.

func (*Proxy) Close

func (p *Proxy) Close() error

Close closes the TCP listener and closes all active connections.

func (*Proxy) CloseConnections

func (p *Proxy) CloseConnections()

CloseConnections closes the currently active connections.

func (*Proxy) HandleConn

func (p *Proxy) HandleConn(conn net.Conn)

HandleConn is used for hooking into github.com/inetaf/tcpproxy

func (*Proxy) ListenAddr

func (p *Proxy) ListenAddr() string

ListenAddr returns the listen address.

func (*Proxy) Start

func (p *Proxy) Start() error

Start starts the proxy.

Jump to

Keyboard shortcuts

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