forward

package
v0.0.0-...-8293206 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnClosed = errors.New("remote connection is closed")
View Source
var ErrRWSizeDismatch = errors.New("read size not equal to write size")

Functions

This section is empty.

Types

type Forward

type Forward struct {
	SrcConn io.ReadWriteCloser
	DstConn io.ReadWriteCloser
	OnError func(error)
}

func NewForward

func NewForward(dst io.ReadWriteCloser, src io.ReadWriteCloser, onError func(error)) *Forward

func (*Forward) SetErrHandle

func (f *Forward) SetErrHandle(cb func(error))

func (*Forward) Start

func (f *Forward) Start()

func (*Forward) Stop

func (f *Forward) Stop()

type TCPForward

type TCPForward struct {
	// addr to listen
	ListenAddr string
	// target host addr
	HostAddr string
	// Error Handle
	OnError func(error)
}

func NewTCPForward

func NewTCPForward(listenAddr, hostAddr string, onError func(error)) *TCPForward

func (*TCPForward) Start

func (tf *TCPForward) Start() error

Jump to

Keyboard shortcuts

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