Documentation ¶
Overview ¶
From JumpServer KoKo
Index ¶
- func ChangeResolver(ipAddr string)
- func CreateDirIfNotExist(path string) (abspath string)
- func CreateFileIfNotExist(file string) (fd *os.File)
- func Debug(args ...interface{})
- func DetectFile(name string) (path string)
- func DetectProcess(pid int) (alive bool)
- func Error(args ...interface{})
- func Fatal(args ...interface{})
- func GenAndSavePriKey(fd *os.File) (pri *rsa.PrivateKey)
- func GenAndSaveRootCert(fd *os.File, pri *rsa.PrivateKey) (crt *x509.Certificate)
- func GenTLSCert(hostname string, crt *x509.Certificate, pri *rsa.PrivateKey) (tls_cert *tls.Certificate, err error)
- func Info(args ...interface{})
- func Initial(LogLevel string, fd *os.File)
- func MitMHandleHttp(server string, subpath string, headers map[string]string, ...)
- func MitMHandleWs(server string, subpath string, headers map[string]string, ...)
- func OpenExistFile(file string) (fd *os.File)
- func Panic(args ...interface{})
- func ReadPriKey(name string) (pri *rsa.PrivateKey)
- func ReadRootCert(name string) (crt *x509.Certificate)
- func RenderTemplateByConfig(config *Config)
- func StartDaemonProcess(configPath string, serviceType string)
- func StopDaemonProcess(workDir string)
- func Warn(args ...interface{})
- type CertLRU
- type Client
- type Config
- type CustomHeaders
- type Daemon
- type Formatter
- type Listener
- type MitMServer
- type NginxConfig
- type Pac
- type ProxyViaHttps
- type ProxyViaWss
- type RemoteServerHttps
- type RemoteServerInfo
- type RemoteServerWss
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeResolver ¶
func ChangeResolver(ipAddr string)
func CreateDirIfNotExist ¶
func CreateFileIfNotExist ¶
func DetectFile ¶
func DetectProcess ¶
func GenAndSavePriKey ¶
func GenAndSavePriKey(fd *os.File) (pri *rsa.PrivateKey)
func GenAndSaveRootCert ¶
func GenAndSaveRootCert(fd *os.File, pri *rsa.PrivateKey) (crt *x509.Certificate)
func GenTLSCert ¶
func GenTLSCert(hostname string, crt *x509.Certificate, pri *rsa.PrivateKey) (tls_cert *tls.Certificate, err error)
func MitMHandleHttp ¶
func MitMHandleWs ¶
func OpenExistFile ¶
func ReadPriKey ¶
func ReadPriKey(name string) (pri *rsa.PrivateKey)
func ReadRootCert ¶
func ReadRootCert(name string) (crt *x509.Certificate)
func RenderTemplateByConfig ¶
func RenderTemplateByConfig(config *Config)
func StartDaemonProcess ¶
run in backgroud
func StopDaemonProcess ¶
func StopDaemonProcess(workDir string)
Types ¶
type CertLRU ¶
type CertLRU struct {
// contains filtered or unexported fields
}
func NewCertLRU ¶
func NewCertLRU(ca *x509.Certificate, pri *rsa.PrivateKey) *CertLRU
type Config ¶
type Config struct { Client Client Server Server NginxConfig NginxConfig }
func ReadClientConfig ¶
func ReadNginxTplConfig ¶
func ReadServerConfig ¶
type CustomHeaders ¶
type Daemon ¶
type Daemon struct { Pid int WorkDir string CertPath string PriKeyPath string LockFilePath string LogLevel string Logger *os.File PriKey *rsa.PrivateKey Cert *x509.Certificate }
func (*Daemon) LoadCertAndPriKey ¶
func (d *Daemon) LoadCertAndPriKey()
func (*Daemon) WatchSignal ¶
func (d *Daemon) WatchSignal()
type Formatter ¶
type Formatter struct { // Timestamp format TimestampFormat string // Available standard keys: time, msg, lvl // Also can include custom fields but limited to strings. // All of fields need to be wrapped inside %% i.e %time% %msg% LogFormat string // Disables the truncation of the level text to 4 characters. DisableLevelTruncation bool }
Formatter implements logrus.Formatter interface.
type MitMServer ¶
type MitMServer struct { Listener *Listener // contains filtered or unexported fields }
func NewMitMServer ¶
func (*MitMServer) Run ¶
func (p *MitMServer) Run()
type NginxConfig ¶
type ProxyViaHttps ¶
type ProxyViaHttps struct { Listener *Listener // contains filtered or unexported fields }
func NewProxyViaHttps ¶
func (*ProxyViaHttps) Run ¶
func (p *ProxyViaHttps) Run()
type ProxyViaWss ¶
type ProxyViaWss struct {
// contains filtered or unexported fields
}
func NewProxyViaWss ¶
func (*ProxyViaWss) Run ¶
func (i *ProxyViaWss) Run()
type RemoteServerHttps ¶
type RemoteServerHttps struct {
// contains filtered or unexported fields
}
func NewRemoteServerHttps ¶
func (*RemoteServerHttps) Run ¶
func (r *RemoteServerHttps) Run()
type RemoteServerInfo ¶
type RemoteServerInfo struct { Host string ComplexPath string CustomHeaders CustomHeaders }
type RemoteServerWss ¶
type RemoteServerWss struct {
// contains filtered or unexported fields
}
func NewRemoteServerWss ¶
func (*RemoteServerWss) Run ¶
func (ws *RemoteServerWss) Run()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.