websocket

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: BSD-3-Clause Imports: 12 Imported by: 6

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
	NetDial          func(network, addr string) (net.Conn, error)
	Proxy            func(*http.Request) (*url.URL, error)
	TLSClientConfig  *tls.Config
	HandshakeTimeout time.Duration
	Subprotocols     []string
	CheckOrigin      func(r *http.Request) bool
}

Transport is websocket transport.

func (*Transport) Accept

func (t *Transport) Accept(w http.ResponseWriter, r *http.Request) (base.Conn, error)

Accept accepts a http request and create Conn.

func (*Transport) Dial

func (t *Transport) Dial(u *url.URL, requestHeader http.Header) (base.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