websocket

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IncomingWebsocketLayer

type IncomingWebsocketLayer struct {
	layer.BaseLayer
	Config *config.Config
	// IncomingSocket is a simulated socket
	IncomingSocket *websocket.IncomingSocket
	// WebsocketNexus handles the socket
	WebsocketNexus *websocket.Nexus
}

IncomingWebsocketLayer is handles websockets.

func NewIncomingWebsocketLayer

func NewIncomingWebsocketLayer(config *config.Config) *IncomingWebsocketLayer

NewIncomingWebsocketLayer creates a new incoming websocket layer.

func (*IncomingWebsocketLayer) AnnounceNexus

func (i *IncomingWebsocketLayer) AnnounceNexus(belowNexus nexusHelper.Nexus)

AnnounceNexus creates a new websocket.WebsocketNexus and registers it.

func (*IncomingWebsocketLayer) Listen

func (i *IncomingWebsocketLayer) Listen(wsURL string, tlsInfo *server.TLSInfo) (err error)

Listen listens at a given wsUrl.

func (*IncomingWebsocketLayer) RegisterAboveLayer

func (i *IncomingWebsocketLayer) RegisterAboveLayer(belowLayer layer.Base)

RegisterAboveLayer registers the current nexuses announce/revoke nexuses to the below layer.

func (*IncomingWebsocketLayer) StopListening

func (i *IncomingWebsocketLayer) StopListening()

StopListening stops listening on the incoming websocket layer.

type OutgoingWebsocketLayer

type OutgoingWebsocketLayer struct {
	layer.BaseLayer
	// NexusBySharedSeed trackers nexuses by shared seed
	NexusBySharedSeed layer.NexusStringMap
	// OutgoingSocketProtocol
	OutgoingSocketProtocol *nws.OutgoingSocket
}

OutgoingWebsocketLayer processes outgoing websocket connections.

func NewOutgoingWebsocketLayer

func NewOutgoingWebsocketLayer() *OutgoingWebsocketLayer

NewOutgoingWebsocketLayer creates a OutgoingWebsocketLayer.

func (*OutgoingWebsocketLayer) AnnounceNexus

func (o *OutgoingWebsocketLayer) AnnounceNexus(belowNexus nexus.Nexus)

AnnounceNexus creates a new nws.WebsocketNexus and registers it.

func (*OutgoingWebsocketLayer) Connect

Connect connects to the outgoing layer.

func (*OutgoingWebsocketLayer) InitiateCloseAll

func (o *OutgoingWebsocketLayer) InitiateCloseAll()

InitiateCloseAll closes all nexuses associated with the layer.

func (*OutgoingWebsocketLayer) RegisterAboveLayer

func (o *OutgoingWebsocketLayer) RegisterAboveLayer(belowLayer layer.Base)

RegisterAboveLayer registers the current nexuses announce/revoke nexuses to the below layer.

Jump to

Keyboard shortcuts

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