package ws

import "k8s.io/kubernetes/Godeps/_workspace/src/github.com/docker/spdystream/ws"

Index

Examples

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.

Code:

{
	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()
}

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)

Source Files

connection.go

Version
v0.13.1-dev
Published
Mar 16, 2015
Platform
js/wasm
Imports
4 packages
Last checked
8 seconds ago

Tools for package owners.