proxy

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 21 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 int
	LocalPort  int
}

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 int) (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() int

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