spdy

package
v0.11.1-0...-a229925 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderSpdy31 = "SPDY/3.1"

Variables

This section is empty.

Functions

func NewClientConnection

func NewClientConnection(conn net.Conn) (httpstream.Connection, error)

NewClientConnection creates a new SPDY client connection.

func NewResponseUpgrader

func NewResponseUpgrader() httpstream.ResponseUpgrader

NewResponseUpgrader returns a new httpstream.ResponseUpgrader that is capable of upgrading HTTP responses using SPDY/3.1 via the spdystream package.

func NewRoundTripper

func NewRoundTripper(tlsConfig *tls.Config) httpstream.UpgradeRoundTripper

NewRoundTripper creates a new SpdyRoundTripper that will use the specified tlsConfig.

func NewServerConnection

func NewServerConnection(conn net.Conn, newStreamHandler httpstream.NewStreamHandler) (httpstream.Connection, error)

NewServerConnection creates a new SPDY server connection. newStreamHandler will be invoked when the server receives a newly created stream from the client.

Types

type SpdyRoundTripper

type SpdyRoundTripper struct {

	// Dialer is the dialer used to connect.  Used if non-nil.
	Dialer *net.Dialer
	// contains filtered or unexported fields
}

SpdyRoundTripper knows how to upgrade an HTTP request to one that supports multiplexed streams. After RoundTrip() is invoked, Conn will be set and usable. SpdyRoundTripper implements the UpgradeRoundTripper interface.

func NewSpdyRoundTripper

func NewSpdyRoundTripper(tlsConfig *tls.Config) *SpdyRoundTripper

NewSpdyRoundTripper creates a new SpdyRoundTripper that will use the specified tlsConfig. This function is mostly meant for unit tests.

func (*SpdyRoundTripper) NewConnection

func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connection, error)

NewConnection validates the upgrade response, creating and returning a new httpstream.Connection if there were no errors.

func (*SpdyRoundTripper) RoundTrip

func (s *SpdyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes the Request and upgrades it. After a successful upgrade, clients may call SpdyRoundTripper.Connection() to retrieve the upgraded connection.

Jump to

Keyboard shortcuts

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