relay

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UseOfClosedNetworkConnection is a special string some parts of
	// go standard lib are using that is the only way to identify some errors
	UseOfClosedNetworkConnection = "use of closed network connection"
	// FailedToSendCloseNotify is an error message from Go net package
	// indicating that the connection was closed by the server.
	FailedToSendCloseNotify = "tls: failed to send closeNotify alert (but connection was closed anyway)"
)

Functions

func Copy

func Copy(dst io.Writer, src io.Reader) (written int64, err error)

func IsFailedToSendCloseNotifyError

func IsFailedToSendCloseNotifyError(err error) bool

IsFailedToSendCloseNotifyError returns true if the provided error is the "tls: failed to send closeNotify".

func IsHostResponded

func IsHostResponded(err error) bool

func IsOKNetworkError

func IsOKNetworkError(err error) bool

IsOKNetworkError returns true if the provided error received from a network operation is one of those that usually indicate normal connection close.

func IsUseOfClosedNetworkError

func IsUseOfClosedNetworkError(err error) bool

IsUseOfClosedNetworkError returns true if the specified error indicates the use of a closed network connection.

func Pipe

func Pipe(tunnelConn, originConn io.ReadWriteCloser)

func PipeBidirectional

func PipeBidirectional(downstream, upstream Stream) error

Types

type Reader

type Reader interface {
	io.ReadCloser
}

type Stream

type Stream interface {
	Reader
	WriterCloser
}

type WriterCloser

type WriterCloser interface {
	io.WriteCloser
}

Jump to

Keyboard shortcuts

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