Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendListFunc ¶
type BackendListFunc func() []string
BackendListFunc returns a slice of backend hosts (hostname:port).
type ReverseProxy ¶
type ReverseProxy struct { // 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 // Logger is the logger for the proxy. Logger log15.Logger // contains filtered or unexported fields }
ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
func NewReverseProxy ¶
func NewReverseProxy(bf BackendListFunc, stickyKey *[32]byte, sticky bool, l log15.Logger) *ReverseProxy
NewReverseProxy initializes a new ReverseProxy with a callback to get backends, a stickyKey for encrypting sticky session cookies, and a flag sticky to enable sticky sessions.
func (*ReverseProxy) ServeConn ¶
func (p *ReverseProxy) ServeConn(ctx context.Context, dconn net.Conn)
ServeConn takes an inbound conn and proxies it to a backend.
func (*ReverseProxy) ServeHTTP ¶
func (p *ReverseProxy) ServeHTTP(ctx context.Context, rw http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler.
Click to show internal directories.
Click to hide internal directories.