Documentation ¶
Index ¶
- type Proxy
- func (p *Proxy) Close() error
- func (p *Proxy) CloseConnections()
- func (p *Proxy) HandleConn(conn net.Conn)
- func (p *Proxy) ListenAddr() string
- func (p *Proxy) SetOnServerRead(onServerRead func(c net.Conn, b []byte) (n int, err error))
- func (p *Proxy) SetOnServerWrite(onServerWrite func(c net.Conn, b []byte) (n int, err error))
- func (p *Proxy) Start() error
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 around https://inet.af/tcpproxy
func NewUnusedAddr ¶
NewUnusedAddr creates a new proxy instance on a unused random port.
func (*Proxy) CloseConnections ¶
func (p *Proxy) CloseConnections()
CloseConnections closes the currently active connections.
func (*Proxy) HandleConn ¶
HandleConn is used for hooking into inet.af/tcpproxy
func (*Proxy) ListenAddr ¶
ListenAddr returns the listen address.
func (*Proxy) SetOnServerRead ¶ added in v0.1.3
SetOnServerRead sets TCP connection Read interceptor. Called when client calls Write.
func (*Proxy) SetOnServerWrite ¶ added in v0.1.3
SetOnServerWrite sets TCP connection Write interceptor. Called when client calls Read.
Click to show internal directories.
Click to hide internal directories.