Documentation ¶
Overview ¶
Package spdy implements Google SPDY™ protocol.
Spec:
http://tools.ietf.org/html/draft-mbelshe-httpbis-spdy-00
http://dev.chromium.org/spdy/spdy-whitepaper
http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2
http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3
Index ¶
Examples ¶
Constants ¶
View Source
const MAX_DATA_LEN int = 10240
Variables ¶
This section is empty.
Functions ¶
func TLSNextProtoFuncV2 ¶
Example ¶
package main import ( "crypto/tls" "github.com/mkch/burrow/spdy" "log" "net/http" ) func main() { ExampleTLSNextProtoFuncV2() } func main() { server := &http.Server{ Addr: ":8080", TLSConfig: &tls.Config{ NextProtos: []string{"spdy/2"}, }, TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){ "spdy/2": spdy.TLSNextProtoFuncV2, }, } http.HandleFunc("/hello", func(w http.ResponseWriter, req *http.Request) { w.Write([]byte("Hello, " + req.URL.String())) if spdy.Spdy(req) { w.Write([]byte(" from SPDY!")) } }) err := server.ListenAndServeTLS("/path/to/host.crt", "/path/to/host.key") if err != nil { log.Fatal(err) } }
Output:
Types ¶
type ResponseWriter ¶
type ResponseWriter interface { http.ResponseWriter // Push initiates an "SPDY Serve Push". // The server response to GET request of url will be pushed to user-agent. // originalRequest is the original request of the ResponseWriter. // The Scheme and Host fields of url can be empty to use the scheme and host // of the original request. Push(url *url.URL, originalRequest *http.Request) error }
Click to show internal directories.
Click to hide internal directories.