wsProxy

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SockAddr = "/tmp/cp9.sock"

Variables

This section is empty.

Functions

This section is empty.

Types

type WsBridge

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

func NewWsbridge

func NewWsbridge(conn *websocket.Conn) (*WsBridge, error)

func (*WsBridge) Close

func (u *WsBridge) Close()

func (*WsBridge) OnDisconnect

func (u *WsBridge) OnDisconnect(conn *pollio.Conn, err error)

func (*WsBridge) OnRequest

func (u *WsBridge) OnRequest(conn *pollio.Conn, data []byte)

func (*WsBridge) Receive

func (u *WsBridge) Receive(data []byte) error

type WsProxy

type WsProxy struct {
	Clients *sync.Map
	Srv     *iohttp.Server
	// contains filtered or unexported fields
}

func NewWsProxy

func NewWsProxy() *WsProxy

func (*WsProxy) AddClient

func (w *WsProxy) AddClient(conn *websocket.Conn) (*WsBridge, error)

func (*WsProxy) DelClient

func (w *WsProxy) DelClient(conn *websocket.Conn)

func (*WsProxy) GetClient

func (w *WsProxy) GetClient(conn *websocket.Conn) (*WsBridge, bool)

func (*WsProxy) OnConnect

func (w *WsProxy) OnConnect(conn *websocket.Conn)

func (*WsProxy) OnDisconnect

func (w *WsProxy) OnDisconnect(conn *websocket.Conn, err error)

func (*WsProxy) OnMessage

func (w *WsProxy) OnMessage(conn *websocket.Conn, messageType websocket.MessageType, data []byte)

func (*WsProxy) Start

func (ws *WsProxy) Start(addr, pem, key string) error

Jump to

Keyboard shortcuts

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