Versions in this module Expand all Collapse all v1 v1.4.0 Dec 13, 2022 Changes in this version + const ONE_GB + const ONE_KB + const ONE_MB + func Address(u *url.URL) string + func AuthCache(r *http.Request) bool + func AuthFailHandler(w http.ResponseWriter, r *http.Request) + func AuthLogin(r *http.Request) + func Connect(acc *HttpAccess, in net.Conn, out net.Conn) + func DebugReqeust(r *http.Request) + func GetUUID() string + func HttpError(w http.ResponseWriter, err string, code int) + func IsConnect(address string, timeout int) bool + func SetVersion(v string) + func StatUpdate(session int64, size int64) + func TlsConfigClient(servername string, certfile, keyfile string) (*tls.Config, error) + func TlsConfigServer(certfile, keyfile string) (*tls.Config, error) + func WriteFull(w io.Writer, body []byte) error + type Access interface + AuthHandlerSet func(func(*AuthInfo) bool) + ForwardHandlerSet func(func(address string, r *http.Request) Forward) + ForwardUpdateHandlerSet func(func(address string, forward Forward)) + Shutdown func() error + func NewHttpsAccess(addr string, timeout int, tlsEnable bool, certfile, keyfile string) (Access, error) + type AuthCtrl struct + Cache map[string]AuthItem + type AuthInfo struct + Token string + User string + func AuthInfoParse(r *http.Request) *AuthInfo + type AuthItem struct + Address string + Login time.Time + type Forward interface + Close func() error + Http func(r *http.Request) (*http.Response, error) + Https func(address string, r *http.Request) (net.Conn, error) + func NewHttpProxyForward(address string, timeout int, auth *AuthInfo, tlsEnable bool, ...) (Forward, error) + func NewLocalForward(timeout int) Forward + type HttpAccess struct + Address string + Timeout int + func (acc *HttpAccess) AuthHandlerSet(handler func(auth *AuthInfo) bool) + func (acc *HttpAccess) AuthHttp(r *http.Request) bool + func (acc *HttpAccess) ForwardHandlerSet(handler func(address string, r *http.Request) Forward) + func (acc *HttpAccess) ForwardUpdate(address string, forward Forward) + func (acc *HttpAccess) ForwardUpdateHandlerSet(handler func(address string, forward Forward)) + func (acc *HttpAccess) HttpForward(address string, r *http.Request) (*http.Response, error) + func (acc *HttpAccess) HttpRoundTripper(r *http.Request) (*http.Response, error) + func (acc *HttpAccess) HttpsForward(address string, r *http.Request) (net.Conn, error) + func (acc *HttpAccess) HttpsRoundTripper(w http.ResponseWriter, r *http.Request) + func (acc *HttpAccess) NoProxyHandler(w http.ResponseWriter, r *http.Request) + func (acc *HttpAccess) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (acc *HttpAccess) Shutdown() error + type HttpProxyForward struct + func (d *HttpProxyForward) Close() error + func (h *HttpProxyForward) Http(r *http.Request) (*http.Response, error) + func (h *HttpProxyForward) Https(address string, r *http.Request) (net.Conn, error) + func (h *HttpProxyForward) ProxyFunc(r *http.Request) (*url.URL, error) + type LocalForward struct + func (d *LocalForward) Close() error + func (d *LocalForward) Http(r *http.Request) (*http.Response, error) + func (d *LocalForward) Https(address string, r *http.Request) (net.Conn, error)