Documentation
¶
Index ¶
Constants ¶
View Source
const ClientProxyConnectionKey = "client-proxy"
ClientProxyConnectionKey is a constant connection key for client proxy, because we don't have to separate connection pools as we need to do when connecting to sandboxes (from orchestrator proxy) to prevent reuse of pool connections by different sandboxes cause failed connections.
View Source
const MaskRequestHostPortPlaceholder = "${PORT}"
Variables ¶
This section is empty.
Functions ¶
func WithDestination ¶
func WithDestination(ctx context.Context, d *Destination) context.Context
Types ¶
type Destination ¶
type Destination struct {
Url *url.URL
SandboxId string
SandboxPort uint64
// Should we return the error about closed port if there is a problem with a connection to upstream?
DefaultToPortError bool
RequestLogger logger.Logger
// ConnectionKey uniquely identifies a single sandbox lifecycle. It is
// used for two purposes:
// 1. keepalive connection pool isolation, so connections to a reused
// IP:port pair are not accidentally shared across sandboxes;
// 2. per-sandbox ingress connection limiter accounting.
// Embedders should pick a value that is unique per lifecycle.
ConnectionKey string
IncludeSandboxIdInProxyErrorLogger bool
// MaskRequestHost is used to mask the request host.
MaskRequestHost *string
// InsecureSkipTLSVerify is read once, when the pool builds the client for
// ConnectionKey; later destinations sharing that key inherit the first
// one's value. Keep it constant per ConnectionKey.
InsecureSkipTLSVerify bool
}
Destination contains information about where to route the request.
type ProxyClient ¶
type ProxyClient struct {
httputil.ReverseProxy
// contains filtered or unexported fields
}
type ProxyPool ¶
type ProxyPool struct {
// contains filtered or unexported fields
}
func (*ProxyPool) CurrentConnections ¶
func (*ProxyPool) Get ¶
func (p *ProxyPool) Get(ctx context.Context, d *Destination) *ProxyClient
func (*ProxyPool) TotalConnections ¶
Click to show internal directories.
Click to hide internal directories.