Documentation
¶
Index ¶
- Constants
- func Close()
- func CloseProxy(address string) error
- func GetGRPCDirector(tlscfg *tls.Config, cfg *config.Config) ...
- func ListenAndServeGRPC(l config.Listen, opts []grpc.ServerOption, cfg *tls.Config) error
- func ListenAndServeHTTP(l config.Listen, h http.Handler, cfg *tls.Config) error
- func ListenAndServeHTTPSTCPSNI(l config.Listen, h http.Handler, p tcp.Handler, cfg *tls.Config, ...) error
- func ListenAndServePrometheus(l config.Listen, pcfg config.Prometheus, cfg *tls.Config) error
- func ListenAndServeTCP(l config.Listen, h tcp.Handler, cfg *tls.Config) error
- func ListenTCP(l config.Listen, cfg *tls.Config) (net.Listener, error)
- func Shutdown(timeout time.Duration)
- type GrpcProxyInterceptor
- type GrpcStatsHandler
- func (h *GrpcStatsHandler) HandleConn(ctx context.Context, conn stats.ConnStats)
- func (h *GrpcStatsHandler) HandleRPC(ctx context.Context, rpc stats.RPCStats)
- func (h *GrpcStatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
- func (h *GrpcStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
- type HTTPProxy
- type HttpStatsHandler
- type InetAfTCPProxyServer
- type Server
Constants ¶
View Source
const StatusClientClosedRequest = 499
StatusClientClosedRequest non-standard HTTP status code for client disconnection
Variables ¶
This section is empty.
Functions ¶
func CloseProxy ¶ added in v1.5.15
func GetGRPCDirector ¶ added in v1.5.11
func ListenAndServeGRPC ¶ added in v1.5.11
func ListenAndServeHTTP ¶ added in v1.4.1
func ListenAndServeHTTPSTCPSNI ¶ added in v1.5.14
func ListenAndServePrometheus ¶ added in v1.6.0
func ListenAndServeTCP ¶ added in v1.4.1
Types ¶
type GrpcProxyInterceptor ¶ added in v1.5.11
type GrpcProxyInterceptor struct { Config *config.Config StatsHandler *GrpcStatsHandler GlobCache *route.GlobCache }
func (GrpcProxyInterceptor) Stream ¶ added in v1.5.11
func (g GrpcProxyInterceptor) Stream(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
type GrpcStatsHandler ¶ added in v1.5.11
type GrpcStatsHandler struct { Connect gkm.Counter Request gkm.Histogram NoRoute gkm.Counter Status gkm.Histogram }
func (*GrpcStatsHandler) HandleConn ¶ added in v1.5.11
func (h *GrpcStatsHandler) HandleConn(ctx context.Context, conn stats.ConnStats)
HandleConn processes the Conn stats.
func (*GrpcStatsHandler) HandleRPC ¶ added in v1.5.11
func (h *GrpcStatsHandler) HandleRPC(ctx context.Context, rpc stats.RPCStats)
func (*GrpcStatsHandler) TagConn ¶ added in v1.5.11
func (h *GrpcStatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
func (*GrpcStatsHandler) TagRPC ¶ added in v1.5.11
func (h *GrpcStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
type HTTPProxy ¶ added in v1.4.1
type HTTPProxy struct { // Config is the proxy configuration as provided during startup. Config config.Proxy // Time returns the current time as the number of seconds since the epoch. // If Time is nil, time.Now is used. Time func() time.Time // Transport is the http connection pool configured with timeouts. // The proxy will panic if this value is nil. Transport http.RoundTripper // InsecureTransport is the http connection pool configured with // InsecureSkipVerify set. This is used for https proxies with // self-signed certs. InsecureTransport http.RoundTripper // Lookup returns a target host for the given request. // The proxy will panic if this value is nil. Lookup func(*http.Request) *route.Target // Logger is the access logger for the requests. Logger logger.Logger // TracerCfg is the Open Tracing configuration as provided during startup TracerCfg config.Tracing // UUID returns a unique id in uuid format. // If UUID is nil, uuid.NewUUID() is used. UUID func() string // Auth schemes registered with the server AuthSchemes map[string]auth.AuthScheme // stats contains all of the stats bits Stats HttpStatsHandler }
HTTPProxy is a dynamic reverse proxy for HTTP and HTTPS protocols.
type HttpStatsHandler ¶ added in v1.6.0
type HttpStatsHandler struct { // Requests is a histogram metric which is updated for every request. Requests gkm.Histogram // Noroute is a counter metric which is updated for every request // where Lookup() returns nil. Noroute gkm.Counter // WSConn counts the number of open web socket connections. WSConn gkm.Gauge // StatusTimer is a histogram for given status codes StatusTimer gkm.Histogram // RedirectCounter - counts redirects RedirectCounter gkm.Counter }
type InetAfTCPProxyServer ¶ added in v1.5.14
type InetAfTCPProxyServer struct { Proxy *tcpproxy.Proxy // contains filtered or unexported fields }
func (*InetAfTCPProxyServer) Close ¶ added in v1.5.14
func (tps *InetAfTCPProxyServer) Close() error
Close - implements Server - is this even called?
func (*InetAfTCPProxyServer) Serve ¶ added in v1.5.14
func (tps *InetAfTCPProxyServer) Serve(_ net.Listener) error
Serve - implements server. The listener is ignored, but it calls serve on the children
func (*InetAfTCPProxyServer) ServeLater ¶ added in v1.5.14
func (tps *InetAfTCPProxyServer) ServeLater(l net.Listener, s Server)
ServeLater - l is really only for listeners that are tcpproxy.TargetListener or a derivative. Don't call after Serve() is called.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package gzip provides an HTTP handler which compresses responses if the client supports this, the response is compressable and not already compressed.
|
Package gzip provides an HTTP handler which compresses responses if the client supports this, the response is compressable and not already compressed. |
Click to show internal directories.
Click to hide internal directories.