spdy

package module
v0.0.0-...-b6b3b6c Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2013 License: BSD-3-Clause Imports: 13 Imported by: 1

README

Experimental spdy package for Go.
http://godoc.org/github.com/kr/spdy

Documentation

Overview

Package spdy implements the SPDY protocol's HTTP layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServeTLS

func ListenAndServeTLS(addr, certFile, keyFile string, h http.Handler) error

ListenAndServeTLS is like http.ListenAndServeTLS, but serves both HTTP and SPDY.

func ReadRequest

func ReadRequest(h, t http.Header, r io.Reader) (*http.Request, error)

ReadRequest reads an HTTP request. The header is taken from h, which must include the SPDY-specific fields starting with ':'. If r is not nil, the body will be read from r. If t is not nil, the trailer will be taken from t after the body is finished.

func ReadResponse

func ReadResponse(h, t http.Header, r io.Reader, req *http.Request) (*http.Response, error)

ReadResponse reads an HTTP response. The header is taken from h, which must include the SPDY-specific fields starting with ':'. If r is not nil, the body will be read from r. If t is not nil, the trailer will be taken from t after the body is finished.

func RequestFramingHeader

func RequestFramingHeader(r *http.Request) (http.Header, framing.ControlFlags, error)

RequestFramingHeader copies r into a header suitable for use in the SPDY framing layer. It includes the SPDY-specific ':' fields such as :scheme, :method, and :version.

Types

type Conn

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

Conn represents a SPDY client connection. It implements http.RoundTripper for making HTTP requests.

func (*Conn) RoundTrip

func (c *Conn) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip implements interface http.RoundTripper.

type Server

type Server struct {
	http.Server
}

func (*Server) ListenAndServeTLS

func (s *Server) ListenAndServeTLS(certFile, keyFile string) error

ListenAndServeTLS is like http.Server.ListenAndServeTLS, but serves both HTTP and SPDY.

func (*Server) ServeConn

func (s *Server) ServeConn(c net.Conn) error

ServeConn serves incoming SPDY requests on c. Most people don't need this; they should use ListenAndServeTLS instead.

Directories

Path Synopsis
Package spdyframing implements the SPDY protocol (currently SPDY/3), described in http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3.
Package spdyframing implements the SPDY protocol (currently SPDY/3), described in http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3.

Jump to

Keyboard shortcuts

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