proxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

func (*Manager) GC

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

func (*Manager) GetRunningProxy

func (m *Manager) GetRunningProxy(name string) (localPort int, targetPort int, 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