backends

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const UDPMaxPacketLen = 65507

UDPMaxPacketLen is the maximum size of a message that can be sent over UDP.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCPDialer

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

TCPDialer implements Backend for outbound TCP.

func NewTCPDialer

func NewTCPDialer(address string, redial bool, tls *tls.Config) (*TCPDialer, error)

NewTCPDialer instantiates a new TCP backend.

func (*TCPDialer) Start

func (b *TCPDialer) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)

Start runs the given session function over this backend service.

type TCPListener

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

TCPListener implements Backend for inbound TCP.

func NewTCPListener

func NewTCPListener(address string, tls *tls.Config) (*TCPListener, error)

NewTCPListener instantiates a new TCPListener backend.

func (*TCPListener) Addr

func (b *TCPListener) Addr() net.Addr

Addr returns the network address the listener is listening on.

func (*TCPListener) Start

Start runs the given session function over the TCPListener backend.

type TCPSession

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

TCPSession implements BackendSession for TCP backend.

func (*TCPSession) Close

func (ns *TCPSession) Close() error

Close closes the session.

func (*TCPSession) Recv

func (ns *TCPSession) Recv(timeout time.Duration) ([]byte, error)

Recv receives data via the session.

func (*TCPSession) Send

func (ns *TCPSession) Send(data []byte) error

Send sends data over the session.

type UDPDialer

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

UDPDialer implements Backend for outbound UDP.

func NewUDPDialer

func NewUDPDialer(address string, redial bool) (*UDPDialer, error)

NewUDPDialer instantiates a new UDPDialer backend.

func (*UDPDialer) Start

func (b *UDPDialer) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)

Start runs the given session function over this backend service.

type UDPDialerSession

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

UDPDialerSession implements BackendSession for UDPDialer.

func (*UDPDialerSession) Close

func (ns *UDPDialerSession) Close() error

Close closes the session.

func (*UDPDialerSession) Recv

func (ns *UDPDialerSession) Recv(timeout time.Duration) ([]byte, error)

Recv receives data via the session.

func (*UDPDialerSession) Send

func (ns *UDPDialerSession) Send(data []byte) error

Send sends data over the session.

type UDPListener

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

UDPListener implements Backend for inbound UDP.

func NewUDPListener

func NewUDPListener(address string) (*UDPListener, error)

NewUDPListener instantiates a new UDPListener backend.

func (*UDPListener) LocalAddr

func (b *UDPListener) LocalAddr() net.Addr

LocalAddr returns the local address the listener is listening on.

func (*UDPListener) Start

Start runs the given session function over the UDPListener backend.

type UDPListenerSession

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

UDPListenerSession implements BackendSession for UDPListener.

func (*UDPListenerSession) Close

func (ns *UDPListenerSession) Close() error

Close closes the session.

func (*UDPListenerSession) Recv

func (ns *UDPListenerSession) Recv(timeout time.Duration) ([]byte, error)

Recv receives data from the session.

func (*UDPListenerSession) Send

func (ns *UDPListenerSession) Send(data []byte) error

Send sends data over the session.

type WebsocketDialer

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

WebsocketDialer implements Backend for outbound Websocket.

func NewWebsocketDialer

func NewWebsocketDialer(address string, tlscfg *tls.Config, extraHeader string, redial bool) (*WebsocketDialer, error)

NewWebsocketDialer instantiates a new WebsocketDialer backend.

func (*WebsocketDialer) Start

Start runs the given session function over this backend service.

type WebsocketListener

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

WebsocketListener implements Backend for inbound Websocket.

func NewWebsocketListener

func NewWebsocketListener(address string, tlscfg *tls.Config) (*WebsocketListener, error)

NewWebsocketListener instantiates a new WebsocketListener backend.

func (*WebsocketListener) Addr

func (b *WebsocketListener) Addr() net.Addr

Addr returns the network address the listener is listening on.

func (*WebsocketListener) Path

func (b *WebsocketListener) Path() string

Path returns the URI path the websocket is configured on.

func (*WebsocketListener) SetPath

func (b *WebsocketListener) SetPath(path string)

SetPath sets the URI path that the listener will be hosted on. It is only effective if used prior to calling Start.

func (*WebsocketListener) Start

Start runs the given session function over the WebsocketListener backend.

type WebsocketSession

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

WebsocketSession implements BackendSession for WebsocketDialer and WebsocketListener.

func (*WebsocketSession) Close

func (ns *WebsocketSession) Close() error

Close closes the session.

func (*WebsocketSession) Recv

func (ns *WebsocketSession) Recv(timeout time.Duration) ([]byte, error)

Recv receives data via the session.

func (*WebsocketSession) Send

func (ns *WebsocketSession) Send(data []byte) error

Send sends data over the session.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳