ws

package
v0.0.0-...-0c426a5 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHandshakeError

func IsHandshakeError(err error) bool

Returns true if a handshake error occured in websockets, which means a response has already been written to the stream.

func NewSender

func NewSender(wsConn *websocket.Conn) (beam.Sender, error)

Connect to a Beam server over a Websocket connection as a client

func Serve

func Serve(u *Upgrader, f BeamFunc) http.HandlerFunc

Handler function for serving Beam over HTTP. Will invoke f and then close the server's Beam endpoint after f returns.

Types

type BeamFunc

type BeamFunc func(beam.Receiver)

type Upgrader

type Upgrader struct {
	Upgrader websocket.Upgrader
}

Upgrade an HTTP connection to a Beam over HTTP2 over Websockets connection.

func (*Upgrader) Upgrade

func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*http2.Server, error)

Jump to

Keyboard shortcuts

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