websocket

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &Transport{}

Default is default transport.

Functions

This section is empty.

Types

type DialError

type DialError struct {
	Response *http.Response
	// contains filtered or unexported fields
}

DialError is the error when dialing to a server. It saves Response from server.

type Transport

type Transport struct {
	ReadBufferSize  int
	WriteBufferSize int

	Subprotocols     []string
	TLSClientConfig  *tls.Config
	HandshakeTimeout time.Duration

	Proxy       func(*http.Request) (*url.URL, error)
	NetDial     func(network, addr string) (net.Conn, error)
	CheckOrigin func(r *http.Request) bool
}

Transport is websocket transport.

func (*Transport) Accept

Accept accepts a http request and create Conn.

func (*Transport) Dial

func (t *Transport) Dial(u *url.URL, requestHeader http.Header) (transport.Conn, error)

Dial creates a new client connection.

func (*Transport) Name

func (t *Transport) Name() string

Name is the name of websocket transport.

Jump to

Keyboard shortcuts

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