Documentation
¶
Index ¶
Constants ¶
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 ¶
NewTCPDialer instantiates a new TCP backend.
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 ¶
func (b *TCPListener) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
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) 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 ¶
NewUDPDialer instantiates a new UDPDialer backend.
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 ¶
func (b *UDPListener) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
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 ¶
func (b *WebsocketDialer) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
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 ¶
func (b *WebsocketListener) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
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.