proxy

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalPortProxyInfo added in v0.5.2

type LocalPortProxyInfo struct {
	Name       string
	TargetPort int32
	LocalPort  int32
}

type Manager

type Manager struct {
	Log *clog.Logger

	Insecure          bool
	TLSCertPath       string
	TLSPrivateKeyPath string

	ProxyBackendScheme       string
	ProxyGracefulShutdownDur time.Duration
	ProxyStartupCheckTimeout time.Duration

	User          string
	MaxAgeSeconds int

	Authorizer auth.Authorizer
	// contains filtered or unexported fields
}

Manager manages local ports and each proxy servers

func (*Manager) CreateNewProxy

func (m *Manager) CreateNewProxy(ctx context.Context, name string, targetPort int32) (LocalPortProxyInfo, error)

func (*Manager) GC

func (m *Manager) GC(ctx context.Context, runningProxyNameList []string)

func (*Manager) GetRunningProxies added in v0.5.2

func (m *Manager) GetRunningProxies() []LocalPortProxyInfo

func (*Manager) GetRunningProxy

func (m *Manager) GetRunningProxy(name string) (proxyInfo LocalPortProxyInfo, exist bool)

func (*Manager) Initialize

func (m *Manager) Initialize() (*Manager, error)

func (*Manager) ShutdownProxy

func (m *Manager) ShutdownProxy(ctx context.Context, name string) error

type ProxyServer

type ProxyServer struct {
	Log           *clog.Logger
	User          string
	StaticFileDir string
	MaxAgeSeconds int
	SessionName   string
	RedirectPath  string

	Insecure          bool
	TLSCertPath       string
	TLSPrivateKeyPath string
	// contains filtered or unexported fields
}

ProxyServer is a http(s) server that serve login UI and reverse-proxy to the backend with authentication

func (*ProxyServer) GetListenerPort

func (p *ProxyServer) GetListenerPort() int32

func (*ProxyServer) Login added in v0.8.0

func (p *ProxyServer) Login(ctx context.Context, req *connect.Request[authv1alpha1.LoginRequest]) (*connect.Response[emptypb.Empty], error)

func (*ProxyServer) SetupAuthorizer

func (p *ProxyServer) SetupAuthorizer(a auth.Authorizer)

func (*ProxyServer) SetupReverseProxy

func (p *ProxyServer) SetupReverseProxy(addr string, targetURL *url.URL) *ProxyServer

func (*ProxyServer) SetupSessionStore

func (p *ProxyServer) SetupSessionStore(hashKey, blockKey []byte)

func (*ProxyServer) Start

func (p *ProxyServer) Start(ctx context.Context, gracefulShutdownDur time.Duration) error

Jump to

Keyboard shortcuts

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