Documentation
¶
Index ¶
- Constants
- Variables
- type HTTPClient
- func (c *HTTPClient) DoReq(req *Request) (*Response, error)
- func (c *HTTPClient) Get(url string) (*Response, error)
- func (c *HTTPClient) PostForm(url string, body []byte) (*Response, error)
- func (c *HTTPClient) PostJson(url string, body []byte) (*Response, error)
- func (c *HTTPClient) PostXml(url string, body []byte) (*Response, error)
- func (c *HTTPClient) SetDebug(debug bool)
- type HostType
- type Request
- type Response
Constants ¶
View Source
const ( DefaultNoProxy = "NO-PROXY" DefaultTimeout = time.Second * 10 )
View Source
const ( MethodConnect = "CONNECT" MethodDelete = "DELETE" MethodGet = "GET" MethodHead = "HEAD" MethodOptions = "OPTIONS" MethodPatch = "PATCH" MethodPost = "POST" MethodPut = "PUT" MethodTrace = "TRACE" )
View Source
const ( IPv4 = HostType(0x000f) IPv6 = HostType(0x00f0) Domain = HostType(0x0f00) )
Variables ¶
View Source
var DirectShortTimeoutClient = &HTTPClient{ Timeout: 3 * time.Second, ProxyAddr: DefaultNoProxy, Debug: false, MaxRedirects: 5, }
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
func NewHTTPClient ¶
func NewHTTPClient(timeout time.Duration, proxyAddr string) (*HTTPClient, error)
func (*HTTPClient) PostForm ¶
func (c *HTTPClient) PostForm(url string, body []byte) (*Response, error)
func (*HTTPClient) PostJson ¶
func (c *HTTPClient) PostJson(url string, body []byte) (*Response, error)
func (*HTTPClient) PostXml ¶
func (c *HTTPClient) PostXml(url string, body []byte) (*Response, error)
func (*HTTPClient) SetDebug ¶
func (c *HTTPClient) SetDebug(debug bool)
type Request ¶
type Request struct {
ID string
// 目标信息
Protocol string
Domain string
IP string
Port string
Path string
Method string
Headers map[string]string
FollowRedirect bool
// 请求处理信息
RawBody []byte
RawHeader []byte
RawRequest []byte
// 特殊信息
IsFromPoC bool
// contains filtered or unexported fields
}
func (*Request) SetBytesBody ¶
func (*Request) SetFollowRedirect ¶
Click to show internal directories.
Click to hide internal directories.