gorilla

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 7 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

DefaultDialer is a gorilla/websocket dialer with all fields set to the default values.

View Source
var DefaultUpgrader = Upgrader(gorilla.Upgrader{})

DefaultUpgrader is a gorilla/websocket Upgrader with all fields set to the default values.

Functions

func Dialer

func Dialer(dialer *gorilla.Dialer, requestHeader http.Header) neffos.Dialer

Dialer is a `neffos.Dialer` type for the gorilla/websocket subprotocol implementation. Should be used on `Dial` to create a new client/client-side connection.

func Upgrader

func Upgrader(upgrader gorilla.Upgrader) neffos.Upgrader

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

Types

type Options

type Options = gorilla.Dialer

Options is just an alias for the `gorilla/websocket.Dialer` struct type.

type Socket

type Socket struct {
	UnderlyingConn *gorilla.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
y or Y : Canonical URL