Documentation ¶
Index ¶
- Constants
- 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 Display()
- func GetFileTimestamp(file string) time.Time
- 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
- type AuthCtrl
- type AuthInfo
- type AuthItem
- type Forward
- type HttpAccess
- 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
- type LocalForward
Constants ¶
View Source
const ( ONE_GB float64 = 1024 * 1024 * 1024 ONE_MB float64 = 1024 * 1024 ONE_KB float64 = 1024 )
Variables ¶
This section is empty.
Functions ¶
func AuthFailHandler ¶
func AuthFailHandler(w http.ResponseWriter, r *http.Request)
func DebugReqeust ¶
func GetFileTimestamp ¶ added in v1.6.0
func SetVersion ¶ added in v1.5.0
func SetVersion(v string)
func StatUpdate ¶ added in v1.5.0
func TlsConfigClient ¶
Types ¶
type Access ¶
type AuthInfo ¶
func AuthInfoParse ¶
type Forward ¶
type Forward interface { Close() error Http(r *http.Request) (*http.Response, error) Https(address string, r *http.Request) (net.Conn, error) }
func NewHttpProxyForward ¶ added in v1.5.0
func NewLocalForward ¶ added in v1.5.0
type HttpAccess ¶
type HttpAccess struct { Timeout int Address string sync.WaitGroup // contains filtered or unexported fields }
func (*HttpAccess) AuthHandlerSet ¶
func (acc *HttpAccess) AuthHandlerSet(handler func(auth *AuthInfo) bool)
func (*HttpAccess) ForwardHandlerSet ¶
func (acc *HttpAccess) ForwardHandlerSet(handler func(address string, r *http.Request) Forward)
func (*HttpAccess) ForwardUpdate ¶ added in v1.4.1
func (acc *HttpAccess) ForwardUpdate(address string, forward Forward)
func (*HttpAccess) ForwardUpdateHandlerSet ¶ added in v1.4.1
func (acc *HttpAccess) ForwardUpdateHandlerSet(handler func(address string, forward Forward))
func (*HttpAccess) HttpForward ¶
func (*HttpAccess) HttpRoundTripper ¶
func (*HttpAccess) HttpsForward ¶
func (*HttpAccess) HttpsRoundTripper ¶
func (acc *HttpAccess) HttpsRoundTripper(w http.ResponseWriter, r *http.Request)
func (*HttpAccess) NoProxyHandler ¶ added in v1.2.7
func (acc *HttpAccess) NoProxyHandler(w http.ResponseWriter, r *http.Request)
func (*HttpAccess) ServeHTTP ¶
func (acc *HttpAccess) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*HttpAccess) Shutdown ¶
func (acc *HttpAccess) Shutdown() error
type HttpProxyForward ¶ added in v1.5.0
type HttpProxyForward struct {
// contains filtered or unexported fields
}
func (*HttpProxyForward) Close ¶ added in v1.5.0
func (d *HttpProxyForward) Close() error
type LocalForward ¶ added in v1.5.0
func (*LocalForward) Close ¶ added in v1.5.0
func (d *LocalForward) Close() error
Click to show internal directories.
Click to hide internal directories.