Documentation
¶
Overview ¶
Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Variables
- func CachePath() (string, error)
- func FingerprintString(f []byte) string
- func GenerateNewCA(capath string) (tls.Certificate, error)
- func KeytalkPath() (string, error)
- func LoadCA(capath string) (tls.Certificate, error)
- type CertPool
- type Client
- type Config
- type Credential
- type Hub
- type Preferences
- type ReverseProxy
- type RoundTripper
- type RoundTripper2
Constants ¶
This section is empty.
Variables ¶
var (
ErrCredentialExpired = errors.New("Certificate has expired.")
)
Functions ¶
func FingerprintString ¶
func GenerateNewCA ¶
func GenerateNewCA(capath string) (tls.Certificate, error)
func KeytalkPath ¶
Types ¶
type CertPool ¶
type CertPool struct {
// contains filtered or unexported fields
}
CertPool is a set of certificates.
func (*CertPool) AddCert ¶
func (s *CertPool) AddCert(cert *x509.Certificate)
AddCert adds a certificate to a pool.
func (*CertPool) AppendCertsFromPEM ¶
AppendCertsFromPEM attempts to parse a series of PEM encoded certificates. It appends any certificates found to s and reports whether any certificates were successfully parsed.
On many Linux systems, /etc/ssl/cert.pem will contain the system wide set of root CAs in a format suitable for this function.
func (*CertPool) Certs ¶
func (s *CertPool) Certs() []*x509.Certificate
type Client ¶
type Client struct {
Preferences Preferences
// contains filtered or unexported fields
}
func (*Client) ListenAndServe ¶
func (client *Client) ListenAndServe()
type Credential ¶
type Credential struct {
Certificate *openssl.Certificate
PrivateKey openssl.PrivateKey
NotBefore time.Time
NotAfter time.Time
ServiceURIs []string
}
func (*Credential) Valid ¶
func (credential *Credential) Valid() error
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
hub maintains the set of active clients and broadcasts messages to the clients.
type Preferences ¶
type Preferences struct {
// contains filtered or unexported fields
}
func (Preferences) Get ¶
func (p Preferences) Get(key string) (interface{}, bool)
func (Preferences) Load ¶
func (p Preferences) Load()
func (Preferences) Set ¶
func (p Preferences) Set(key string, val interface{})
func (Preferences) Sync ¶
func (p Preferences) Sync()
type ReverseProxy ¶
type ReverseProxy struct {
// Director must be a function which modifies
// the request into a new request to be sent
// using Transport. Its response is then copied
// back to the original client unmodified.
Director func(*http.Request)
// The transport used to perform proxy requests.
// If nil, http.DefaultTransport is used.
Transport http.RoundTripper
// FlushInterval specifies the flush interval
// to flush to the client while copying the
// response body.
// If zero, no periodic flushing is done.
FlushInterval time.Duration
}
ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
func NewSingleHostReverseProxy ¶
func NewSingleHostReverseProxy() *ReverseProxy
NewSingleHostReverseProxy returns a new ReverseProxy that rewrites URLs to the scheme, host, and base path provided in target. If the target's path is "/base" and the incoming request was for "/dir", the target request will be for /base/dir.
func (*ReverseProxy) ServeHTTP ¶
func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type RoundTripper ¶
type RoundTripper struct {
// contains filtered or unexported fields
}