gospdy: github.com/jmckaskill/gospdy Index | Files

package spdy

import "github.com/jmckaskill/gospdy"


Package Files

buffer.go client.go connection.go errors.go packets.go server.go stream.go


const (
    LowPriority     = 3
    HighPriority    = -4
    DefaultPriority = 0


var DefaultClient = &http.Client{Transport: DefaultTransport}
var DefaultTransport http.RoundTripper = &Transport{
    Proxy:          http.ProxyFromEnvironment,
    FallbackClient: http.DefaultClient,
var Log = func(fmt string, args ...interface{}) {}

func ListenAndServe Uses

func ListenAndServe(addr string, handler http.Handler) error

ListenAndServe listens for unencrypted SPDY connections on addr. Because it does not use TLS/SSL of this it can't use the next protocol negotation in TLS to fall back on standard HTTP.

func ListenAndServeTLS Uses

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

ListenAndServeTLS listens for encrpyted SPDY or HTTPS connections on addr. It uses the TLS next negotation protocol to fallback on standard https.

type Connection Uses

type Connection struct {
    // contains filtered or unexported fields

data in connections are only accessible on the connection dispatch thread

func NewConnection Uses

func NewConnection(sock net.Conn, handler http.Handler, version int, server bool) *Connection

NewConnection creates a SPDY client or server connection around sock.

sock should be the underlying socket already connected. Typically this is a TLS connection which has already gone through next protocol negotiation, but any socket will work.

Handler is used to provide the callback for any content pushed from the server. If it is nil then pushed streams are refused.

The connection won't be started until you run Connection.Run()

func (*Connection) Run Uses

func (c *Connection) Run()

run runs the main connection thread which is responsible for dispatching messages to the streams and managing the list of streams.

type RequestExtra Uses

type RequestExtra struct {
    Unidirectional    bool
    Priority          int
    AssociatedHandler http.Handler

type Stream Uses

type Stream interface {
    SetPriority(priority int)
    Priority() int
    PushRequest(req *http.Request, extra *RequestExtra) (*http.Response, error)
    RoundTrip(r *http.Request) (*http.Response, error)

type Transport Uses

type Transport struct {

    Proxy           func(*http.Request) (*url.URL, error)
    Dial            func(net, addr string) (c net.Conn, err error)
    TLSClientConfig *tls.Config
    FallbackClient  *http.Client
    // contains filtered or unexported fields

func (*Transport) RoundTrip Uses

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

Package spdy imports 18 packages (graph) and is imported by 3 packages. Updated 2016-07-26. Refresh now. Tools for package owners.