httpproxy

package
v10.79.3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferPool

type BufferPool struct {
	// contains filtered or unexported fields
}

BufferPool implements the interface of httputil.BufferPool in order to improve memory utilization in the reverse proxy.

func NewPool

func NewPool() *BufferPool

NewPool creates a new BufferPool.

func (*BufferPool) Get

func (b *BufferPool) Get() []byte

Get gets a buffer from the pool.

func (*BufferPool) Put

func (b *BufferPool) Put(buf []byte)

Put returns the buffer to the pool.

type Config

type Config struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Config maintains state for proxies connections from listen to backend.

func NewHTTPProxy

func NewHTTPProxy(
	c collector.EventCollector,
	puContext string,
	puFromIDCache cache.DataStore,
	caPool *x509.CertPool,
	authProcessorCache cache.DataStore,
	dependentAPICache cache.DataStore,
	applicationProxy bool,
	mark int,
	secrets secrets.Secrets,
	portCache map[int]*policy.ApplicationService,
	portMapping map[int]int,
) *Config

NewHTTPProxy creates a new instance of proxy reate a new instance of Proxy

func (*Config) GetCertificateFunc

func (p *Config) GetCertificateFunc() func(*tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificateFunc implements the TLS interface for getting the certificate. This allows us to update the certificates of the connection on the fly.

func (*Config) RunNetworkServer

func (p *Config) RunNetworkServer(ctx context.Context, l net.Listener, encrypted bool) error

RunNetworkServer runs an HTTP network server. If TLS is needed, the listener should be already a TLS listener.

func (*Config) ShutDown

func (p *Config) ShutDown() error

ShutDown terminates the server.

func (*Config) UpdateCaches

func (p *Config) UpdateCaches(portCache map[int]*policy.ApplicationService, portMap map[int]int)

UpdateCaches updates the port mapping caches.

func (*Config) UpdateSecrets

func (p *Config) UpdateSecrets(cert *tls.Certificate, caPool *x509.CertPool, s secrets.Secrets, certPEM, keyPEM string)

UpdateSecrets updates the secrets

type JWTClaims

type JWTClaims struct {
	jwt.StandardClaims
	SourceID string
	Scopes   []string
	Profile  []string
}

JWTClaims is the structure of the claims we are sending on the wire.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL