ws

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2015 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	*websocket.Conn
	// contains filtered or unexported fields
}

Wrap an HTTP2 connection over WebSockets and use the underlying WebSocket framing for proxy compatibility.

Example

Connect to the Websocket endpoint at ws://localhost using SPDY over Websockets framing.

wsconn, _, _ := websocket.DefaultDialer.Dial("ws://localhost/", http.Header{"Origin": {"http://localhost/"}})
conn, _ := spdystream.NewConnection(NewConnection(wsconn), false)
go conn.Serve(spdystream.NoOpStreamHandler, spdystream.NoAuthHandler)
stream, _ := conn.CreateStream(http.Header{}, nil, false)
stream.Wait()
Output:

func NewConnection

func NewConnection(w *websocket.Conn) *Conn

func (Conn) Close

func (c Conn) Close() error

func (Conn) Read

func (c Conn) Read(b []byte) (int, error)

func (Conn) SetDeadline

func (c Conn) SetDeadline(t time.Time) error

func (Conn) Write

func (c Conn) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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