websocket

package
v0.3.0-prep Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExpectedWSCloseError

func IsExpectedWSCloseError(err error) bool

IsExpectedWSCloseError returns boolean indicating whether the error is a clean disconnection.

Types

type DialErr

type DialErr struct {
	URL          *url.URL
	HTTPResponse *http.Response
}

func (DialErr) Error

func (de DialErr) Error() string

type Websocket

type Websocket interface {
	io.Reader
	io.Writer
	Close() error
}

Websocket exposes the bits of *websocket.Conn we actually use. Note that we are emulating an `io.ReadWriter`. This is to be able to support RPC codecs, which operate on byte streams.

func Dial

func Dial(client *http.Client, ua string, token flux.Token, u *url.URL) (Websocket, error)

Dial initiates a new websocket connection.

func Ping

func Ping(c *websocket.Conn) Websocket

Ping adds a periodic ping to a websocket connection.

func Upgrade

func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (Websocket, error)

Upgrade upgrades the HTTP server connection to the WebSocket protocol.

Jump to

Keyboard shortcuts

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