requests

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client           *http.Client
	ClientNoRedirect *http.Client
	DialTimout       = 5 * time.Second
	KeepAlive        = 15 * time.Second
)
View Source
var (
	GC gcache.Cache
)

Functions

func DoRequest

func DoRequest(req *http.Request, redirect bool) (*http.Response, int64, error)

func GetRespBody

func GetRespBody(oResp *http.Response) ([]byte, error)

func InitCache

func InitCache(size int)

func InitHttpClient

func InitHttpClient(ThreadsNum int, DownProxy string, Timeout time.Duration) error

func ParseHttpRequest

func ParseHttpRequest(oReq *http.Request) (*structs.Request, error)

func ParseHttpResponse

func ParseHttpResponse(oResp *http.Response, milliseconds int64) (*structs.Response, error)

func ParseTCPUDPRequest

func ParseTCPUDPRequest(content []byte) (*structs.Request, error)

func ParseTCPUDPResponse

func ParseTCPUDPResponse(content []byte, socket *net.Conn, transport string) (*structs.Response, error)

func ParseUrl

func ParseUrl(u *url.URL) *structs.UrlType

func PutAddrType

func PutAddrType(addrType *structs.AddrType)

func PutConnectInfo

func PutConnectInfo(connInfo *structs.ConnInfoType)

func PutRequest

func PutRequest(request *structs.Request)

func PutResponse

func PutResponse(response *structs.Response)

func PutUrlType

func PutUrlType(urlType *structs.UrlType)

func XrayGetHttpRequestCache

func XrayGetHttpRequestCache(ruleReq *structs.RuleRequest) (*http.Request, *structs.Request, *structs.Response, bool)

func XrayGetTcpUdpConnectionCache

func XrayGetTcpUdpConnectionCache(connectionId string) (*net.Conn, bool)

func XrayGetTcpUdpResponseCache

func XrayGetTcpUdpResponseCache(content string) ([]byte, *structs.Response, bool)

func XraySetHttpRequestCache

func XraySetHttpRequestCache(ruleReq *structs.RuleRequest, request *http.Request, protoRequest *structs.Request, protoResponse *structs.Response) bool

func XraySetTcpUdpConnectionCache

func XraySetTcpUdpConnectionCache(connectionId string, conn *net.Conn) bool

func XraySetTcpUdpResponseCache

func XraySetTcpUdpResponseCache(content string, response []byte, protoResponse *structs.Response) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL