Version: v0.0.18 Latest Latest

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 10 Imported by: 4




This section is empty.


View Source
var DefaultDialer = Dialer(gobwas.DefaultDialer)

DefaultDialer is a gobwas/ws dialer with all fields set to the default values.

View Source
var DefaultUpgrader = Upgrader(gobwas.HTTPUpgrader{})

DefaultUpgrader is a gobwas/ws HTTP Upgrader with all fields set to the default values.


func Dialer

func Dialer(dialer gobwas.Dialer) neffos.Dialer

Dialer is a `neffos.Dialer` type for the gobwas/ws subprotocol implementation. Should be used on `Dial` to create a new client/client-side connection. To send headers to the server set the dialer's `Header` field to a `gobwas.HandshakeHeaderHTTP`.

func Upgrader

func Upgrader(upgrader gobwas.HTTPUpgrader) neffos.Upgrader

Upgrader is a `neffos.Upgrader` type for the gobwas/ws subprotocol implementation. Should be used on `neffos.New` to construct the neffos server.


type Header = gobwas.HandshakeHeaderHTTP

Header is an alias to the adapter that allows the use of `http.Header` as `gobwas/ws.Dialer.HandshakeHeader`.

type Options

type Options = gobwas.Dialer

Options is just an alias for the `gobwas/ws.Dialer` struct type.

type Socket

type Socket struct {
	UnderlyingConn net.Conn
	// contains filtered or unexported fields

Socket completes the `neffos.Socket` interface, it describes the underline websocket connection.

func (*Socket) NetConn

func (s *Socket) NetConn() net.Conn

NetConn returns the underline net connection.

func (*Socket) ReadData

func (s *Socket) ReadData(timeout time.Duration) ([]byte, neffos.MessageType, error)

ReadData reads binary or text messages from the remote connection.

func (*Socket) Request

func (s *Socket) Request() *http.Request

Request returns the http request value.

func (*Socket) WriteBinary

func (s *Socket) WriteBinary(body []byte, timeout time.Duration) error

WriteBinary sends a binary message to the remote connection.

func (*Socket) WriteText

func (s *Socket) WriteText(body []byte, timeout time.Duration) error

WriteText sends a text message to the remote connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL