Documentation
¶
Index ¶
- func GetLocalIdlePort() (int, error)
- func IsPrivateIP(ip string) bool
- func IsPrivateIPEx(ip string) bool
- type EasyHTTP
- func (s *EasyHTTP) Get(urlPath string) ([]byte, error)
- func (s *EasyHTTP) HTTProxy(rw http.ResponseWriter, req *http.Request, targetHostSchemed string)
- func (s *EasyHTTP) Options(options *HTTPOptions) *EasyHTTP
- func (s *EasyHTTP) PostJSON(urlPath string, data interface{}) ([]byte, error)
- func (s *EasyHTTP) PostWwwForm(urlPath string, data map[string]string) ([]byte, error)
- func (s *EasyHTTP) SetOptions(options *HTTPOptions)
- type HTTPOptions
- type HTTPRealIP
- type IRealIP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EasyHTTP ¶
type EasyHTTP struct {
// contains filtered or unexported fields
}
EasyHTTP easy http request
func (*EasyHTTP) HTTProxy ¶
HTTProxy 转发http请求
arg: targetHostSchemed, examples "https://baog.xxxx.com"
func (*EasyHTTP) Options ¶
func (s *EasyHTTP) Options(options *HTTPOptions) *EasyHTTP
Options return a new EasyHTTP with options in input
func (*EasyHTTP) PostWwwForm ¶
PostWwwForm post x-www-form-urlencoded
func (*EasyHTTP) SetOptions ¶
func (s *EasyHTTP) SetOptions(options *HTTPOptions)
SetOptions set options for http request
type HTTPOptions ¶
HTTPOptions options for http request
type HTTPRealIP ¶
type HTTPRealIP struct { }
HTTPRealIP implemention of the interface IRealIP
func (*HTTPRealIP) ClientIP ¶
func (m *HTTPRealIP) ClientIP(r *http.Request) string
ClientIP get client ip
func (*HTTPRealIP) ClientPublicIP ¶
func (m *HTTPRealIP) ClientPublicIP(r *http.Request) string
ClientPublicIP get client's public ip addr
func (*HTTPRealIP) IsPrivateIP ¶
func (m *HTTPRealIP) IsPrivateIP(ip string) bool
IsPrivateIP check the ip address whether priviate or not
Click to show internal directories.
Click to hide internal directories.