flux: github.com/weaveworks/flux/pkg/http/websocket Index | Files

package websocket

import "github.com/weaveworks/flux/pkg/http/websocket"

Index

Package Files

client.go ping.go server.go websocket.go

func IsExpectedWSCloseError Uses

func IsExpectedWSCloseError(err error) bool

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

type DialErr Uses

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

func (DialErr) Error Uses

func (de DialErr) Error() string

type Websocket Uses

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 Uses

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

Dial initiates a new websocket connection.

func Ping Uses

func Ping(c *websocket.Conn) Websocket

Ping adds a periodic ping to a websocket connection.

func Upgrade Uses

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

Upgrade upgrades the HTTP server connection to the WebSocket protocol.

Package websocket imports 10 packages (graph). Updated 2019-09-29. Refresh now. Tools for package owners.