wfgobwas

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MinPingTime = 3 * time.Second

Variables

This section is empty.

Functions

func NewDialer

func NewDialer(idleTime time.Duration) neffos.Dialer

func NewUpgrader

func NewUpgrader(idleTime time.Duration) neffos.Upgrader

Types

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) SendPing

func (s *Socket) SendPing()

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