Documentation
¶
Overview ¶
This package contains the proxy core - the main proxy function that accepts and modifies request, forwards or denies it.
Index ¶
Constants ¶
View Source
const ( DefaultHttpReadTimeout = time.Duration(10) * time.Second DefaultHttpDialTimeout = time.Duration(10) * time.Second )
Standard dial and read timeouts, can be overriden when supplying proxy settings
View Source
const TRUST_FORWARD_HEADER = false
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProxySettings ¶
type ProxySettings struct { // Controlller tells proxy what to do with each request Controller control.Controller // MemoryBackend or CassandraBackend ThrottlerBackend backend.Backend // Load balancing algo, e.g. RandomLoadBalancer LoadBalancer loadbalance.Balancer // How long would proxy wait for server response HttpReadTimeout time.Duration // How long would proxy try to dial server HttpDialTimeout time.Duration }
Reverse proxy settings, what loadbalancing algo to use, timeouts, rate limiting backend
type ReverseProxy ¶
type ReverseProxy struct {
// contains filtered or unexported fields
}
This is a reverse proxy, not meant to be created directly, use NewReverseProxy function instead
func NewReverseProxy ¶
func NewReverseProxy(metrics *metrics.ProxyMetrics, s *ProxySettings) (*ReverseProxy, error)
Creates reverse proxy that acts like http server.
func (*ReverseProxy) Get ¶
func (p *ReverseProxy) Get(w http.ResponseWriter, hosts []string, query client.MultiDict, auth *netutils.BasicAuth) error
Vulcan implements Getter interface that is used by controllers to issue concurrent get requests with failover
func (*ReverseProxy) ServeHTTP ¶
func (p *ReverseProxy) ServeHTTP(w http.ResponseWriter, req *http.Request)
Main request handler, accepts requests, round trips it to the upstream proxies back the response.
Directories
¶
Path | Synopsis |
---|---|
Cassandra backend based on counters.
|
Cassandra backend based on counters. |
js
This package implements vulcan controller and is based on Robert Krimen's Otto javascript magnificent interpreter.
|
This package implements vulcan controller and is based on Robert Krimen's Otto javascript magnificent interpreter. |
roundrobin
Implements round robin load balancing algorithm.
|
Implements round robin load balancing algorithm. |
Click to show internal directories.
Click to hide internal directories.