Versions in this module Expand all Collapse all v0 v0.0.0 Sep 24, 2025 Changes in this version + const MaxUdpPacket + var ErrUseLastResponse = http.ErrUseLastResponse + func NewJar() *jar + func NewRequestWithContext(ctx context.Context, method string, u *url.URL, body io.Reader) (*http.Request, error) + func WriteUdpAddr(w io.Writer, addr Address) error + type Address struct + Host string + IP net.IP + Name string + NetWork string + Password string + Port int + Scheme string + User string + func GetAddressWithAddr(addrS string) (addr Address, err error) + func GetAddressWithUrl(uurl *url.URL) (addr Address, err error) + func ReadUdpAddr(r io.Reader) (Address, error) + func (a Address) Network() string + func (a Address) String() string + type Client struct + func NewClient(preCtx context.Context, options ...ClientOption) (*Client, error) + func (obj *Client) ClearCookies() + func (obj *Client) Close() + func (obj *Client) CloseConns() + func (obj *Client) Connect(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) Delete(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) ForceCloseConns() + func (obj *Client) Get(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) GetCookies(href *url.URL) Cookies + func (obj *Client) Head(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) Options(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) Patch(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) Post(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) Put(ctx context.Context, href string, options ...RequestOption) (*Response, error) + func (obj *Client) Request(ctx context.Context, method string, href string, options ...RequestOption) (response *Response, err error) + func (obj *Client) SetCookies(href *url.URL, cookies ...any) error + func (obj *Client) SetProxy(proxyUrl string) (err error) + func (obj *Client) SetProxys(proxyUrls []string) (err error) + func (obj *Client) Trace(ctx context.Context, href string, options ...RequestOption) (*Response, error) + type ClientOption struct + Bar bool + DialOption DialOption + DisCookie bool + DisDecode bool + DisUnZip bool + ErrCallBack func(ctx *Response) error + ForceHttp1 bool + GetProxy func(ctx *Response) (string, error) + GetProxys func(ctx *Response) ([]string, error) + H2Ja3Spec ja3.H2Spec + H3 bool + Headers any + Ja3 bool + Ja3Spec ja3.Spec + Jar Jar + Logger func(Log) + MaxRedirect int + MaxRetries int + OptionCallBack func(ctx *Response) error + OrderHeaders []string + Proxy string + Proxys []string + QuicConfig *quic.Config + RequestCallBack func(ctx *Response) error + ResponseHeaderTimeout time.Duration + ResultCallBack func(ctx *Response) error + Timeout time.Duration + TlsConfig *tls.Config + TlsHandshakeTimeout time.Duration + UJa3Spec ja3.USpec + UquicConfig *uquic.Config + UserAgent string + UtlsConfig *utls.Config + type Conn interface + CloseWithError func(err error) error + DoRequest func(*http.Request, []string) (*http.Response, error) + type Cookies []*http.Cookie + func ReadCookies(val any) (Cookies, error) + func (obj Cookies) Get(name string) *http.Cookie + func (obj Cookies) GetVal(name string) string + func (obj Cookies) GetVals(name string) []string + func (obj Cookies) Gets(name string) Cookies + func (obj Cookies) String() string + type DialOption struct + AddrType gtls.AddrType + DialTimeout time.Duration + Dns *net.UDPAddr + GetAddrType func(host string) gtls.AddrType + KeepAlive time.Duration + LocalAddr *net.TCPAddr + type Dialer struct + func (obj *Dialer) DialContext(ctx *Response, network string, addr Address) (net.Conn, error) + func (obj *Dialer) DialProxyContext(ctx *Response, network string, proxyTlsConfig *tls.Config, ...) (net.PacketConn, net.Conn, error) + func (obj *Dialer) ProxyDialContext(ctx *Response, network string, addr Address) (net.Conn, error) + func (obj *Dialer) Socks5TcpProxy(ctx *Response, proxyAddr Address, remoteAddr Address) (conn net.Conn, err error) + func (obj *Dialer) Socks5UdpProxy(ctx *Response, proxyAddress Address, remoteAddress Address) (udpConn net.PacketConn, err error) + type Event struct + Comment string + Data string + Event string + Id string + Retry int + type File struct + Content any + ContentType string + FileName string + type Jar interface + ClearCookies func() + GetCookies func(u *url.URL) Cookies + SetCookies func(*url.URL, Cookies) + type Log struct + Id string + Msg any + Time time.Time + Type LogType + type LogType string + const LogType_DNSLookup + const LogType_ProxyConnectRemote + const LogType_ProxyDNSLookup + const LogType_ProxyTCPConnect + const LogType_ProxyTLSHandshake + const LogType_ResponseBody + const LogType_ResponseHeader + const LogType_TCPConnect + const LogType_TLSHandshake + type OrderMap struct + func NewOrderMap() *OrderMap + func (obj *OrderMap) Del(key string) + func (obj *OrderMap) Keys() []string + func (obj *OrderMap) MarshalJSON() ([]byte, error) + func (obj *OrderMap) Set(key string, val any) + type RequestOption struct + Body any + ContentType string + Cookies any + Data any + DisProxy bool + Form any + Host string + Json any + Method string + Params any + Referer string + Stream bool + Text any + Url *url.URL + WsOption websocket.Option + type Response struct + func Connect(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func Delete(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func Get(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func Head(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func NewResponse(ctx context.Context, option RequestOption) *Response + func Options(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func Patch(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func Post(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func Put(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func Request(ctx context.Context, method string, href string, options ...RequestOption) (resp *Response, err error) + func Trace(ctx context.Context, href string, options ...RequestOption) (resp *Response, err error) + func (obj *Response) Body() io.ReadCloser + func (obj *Response) Client() *Client + func (obj *Response) CloseBody() + func (obj *Response) CloseConn() + func (obj *Response) Content() []byte + func (obj *Response) ContentEncoding() string + func (obj *Response) ContentLength() int64 + func (obj *Response) ContentType() string + func (obj *Response) Context() context.Context + func (obj *Response) Cookies() Cookies + func (obj *Response) Decode(encoding string) + func (obj *Response) Err() error + func (obj *Response) ForceCloseConn() + func (obj *Response) Headers() http.Header + func (obj *Response) Html() *bs4.Client + func (obj *Response) IsNewConn() bool + func (obj *Response) IsSSE() bool + func (obj *Response) IsStream() bool + func (obj *Response) IsWebSocket() bool + func (obj *Response) Json(vals ...any) (*gson.Client, error) + func (obj *Response) Location() (*url.URL, error) + func (obj *Response) Map() (data map[string]any, err error) + func (obj *Response) Option() *RequestOption + func (obj *Response) Proto() string + func (obj *Response) Proxys() []Address + func (obj *Response) ReadBody() (err error) + func (obj *Response) Request() *http.Request + func (obj *Response) Response() *http.Response + func (obj *Response) SSE() *SSE + func (obj *Response) SetContent(val []byte) + func (obj *Response) Status() string + func (obj *Response) StatusCode() int + func (obj *Response) Text() string + func (obj *Response) Url() *url.URL + func (obj *Response) WebSocket() *websocket.Conn + type SSE struct + func (obj *SSE) Close() + func (obj *SSE) Range() iter.Seq2[Event, error] + func (obj *SSE) Recv() (Event, error) + type UDPConn struct + UDPConn *net.UDPConn + func NewUDPConn(packConn net.PacketConn, proxyAddress net.Addr) (*UDPConn, error) + func (c *UDPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) + func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error) + func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) + func (c *UDPConn) SetDeadline(t time.Time) error + func (c *UDPConn) SetReadBuffer(bytes int) error + func (c *UDPConn) SetReadDeadline(t time.Time) error + func (c *UDPConn) SetWriteBuffer(bytes int) error + func (c *UDPConn) SetWriteDeadline(t time.Time) error + func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error) + func (c *UDPConn) WriteTo(p []byte, addr net.Addr) (n int, err error) + func (c *UDPConn) WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)