Documentation ¶
Index ¶
- func Main()
- type Authenticator
- type CertManager
- func (cm *CertManager) Add(host string, certfile, keyfile string, pem string, cafile, capem string) error
- func (cm *CertManager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (cm *CertManager) GetConfigForClient(hello *tls.ClientHelloInfo) (*tls.Config, error)
- func (cm *CertManager) HostPolicy(_ context.Context, host string) error
- type Config
- type FlushWriter
- type HTTP2Handler
- type HTTPHandler
- type HtpasswdFileAuth
- type MultiSNHandler
- type SimplePAM
- type TCPListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
type CertManager ¶
type CertManager struct { RejectNilSni bool // contains filtered or unexported fields }
func (*CertManager) GetCertificate ¶
func (cm *CertManager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
func (*CertManager) GetConfigForClient ¶
func (cm *CertManager) GetConfigForClient(hello *tls.ClientHelloInfo) (*tls.Config, error)
func (*CertManager) HostPolicy ¶
func (cm *CertManager) HostPolicy(_ context.Context, host string) error
type Config ¶
type Config struct { Default struct { LogLevel int DaemonStderr string RejectNilSni bool } HTTP2 []struct { Network string Listen string ServerName []string KeyFile string CertFile string PEM string ClientAuthFile string ClientAuthPem string UpstreamProxy string ProxyFallback string DisableProxy bool ProxyAuthMethod string ProxyAuthHtpasswdPath string } HTTP struct { Network string Listen string UpstreamProxy string ProxyAuthMethod string ProxyAuthHtpasswdPath string } }
Config contains the configuration for Yap
type FlushWriter ¶
type FlushWriter struct {
// contains filtered or unexported fields
}
FlushWriter is a wrapper for io.Writer. When call the Write method, FlushWriter will try to call Flush after call Write for the io.Writer
type HTTP2Handler ¶
type HTTP2Handler struct { ServerNames []string Fallback *url.URL DisableProxy bool Dial func(network, address string) (net.Conn, error) *http.Transport Authenticator }
HTTP2Handler serves as a HTTP2 proxy
func (*HTTP2Handler) ProxyAuthorizationRequired ¶
func (h *HTTP2Handler) ProxyAuthorizationRequired(rw http.ResponseWriter, req *http.Request)
ProxyAuthorizationRequired returns Proxy-Authenticate to the client
func (*HTTP2Handler) ServeHTTP ¶
func (h *HTTP2Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler interface
type HTTPHandler ¶
type HTTPHandler struct { Dial func(network, address string) (net.Conn, error) *http.Transport Authenticator }
HTTPHandler serves as a HTTP proxy
func (*HTTPHandler) ProxyAuthorizationRequired ¶
func (h *HTTPHandler) ProxyAuthorizationRequired(rw http.ResponseWriter, req *http.Request)
ProxyAuthorizationRequired returns Proxy-Authenticate to the client
func (*HTTPHandler) ServeHTTP ¶
func (h *HTTPHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler interface
type HtpasswdFileAuth ¶
type HtpasswdFileAuth struct { CacheSize uint FilePath string // contains filtered or unexported fields }
func (*HtpasswdFileAuth) Authenticate ¶
func (h *HtpasswdFileAuth) Authenticate(username, password string) error
type MultiSNHandler ¶
MultiSNHandler contains multiple server name and their handler
func (*MultiSNHandler) ServeHTTP ¶
func (h *MultiSNHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler interface
type SimplePAM ¶
type SimplePAM struct { CacheSize uint // contains filtered or unexported fields }
func (*SimplePAM) Authenticate ¶
type TCPListener ¶
type TCPListener struct {
*net.TCPListener
}
TCPListener customize net.TCPListener for Yap
Click to show internal directories.
Click to hide internal directories.