package fasthttpproxy

import "github.com/valyala/fasthttp/fasthttpproxy"

Index

Functions

func FasthttpHTTPDialer

func FasthttpHTTPDialer(proxy string) fasthttp.DialFunc

FasthttpHTTPDialer returns a fasthttp.DialFunc that dials using the provided HTTP proxy.

Example usage:

c := &fasthttp.Client{
	Dial: fasthttpproxy.FasthttpHTTPDialer("username:password@localhost:9050"),
}

func FasthttpHTTPDialerTimeout

func FasthttpHTTPDialerTimeout(proxy string, timeout time.Duration) fasthttp.DialFunc

FasthttpHTTPDialerTimeout returns a fasthttp.DialFunc that dials using the provided HTTP proxy using the given timeout.

Example usage:

c := &fasthttp.Client{
	Dial: fasthttpproxy.FasthttpHTTPDialerTimeout("username:password@localhost:9050", time.Second * 2),
}

func FasthttpProxyHTTPDialer

func FasthttpProxyHTTPDialer() fasthttp.DialFunc

FasthttpProxyHTTPDialer returns a fasthttp.DialFunc that dials using the the env(HTTP_PROXY, HTTPS_PROXY and NO_PROXY) configured HTTP proxy.

Example usage:

c := &fasthttp.Client{
	Dial: FasthttpProxyHTTPDialer(),
}

func FasthttpProxyHTTPDialerTimeout

func FasthttpProxyHTTPDialerTimeout(timeout time.Duration) fasthttp.DialFunc

FasthttpProxyHTTPDialerTimeout returns a fasthttp.DialFunc that dials using the env(HTTP_PROXY, HTTPS_PROXY and NO_PROXY) configured HTTP proxy using the given timeout.

Example usage:

c := &fasthttp.Client{
	Dial: FasthttpProxyHTTPDialerTimeout(time.Second * 2),
}

func FasthttpSocksDialer

func FasthttpSocksDialer(proxyAddr string) fasthttp.DialFunc

FasthttpSocksDialer returns a fasthttp.DialFunc that dials using the provided SOCKS5 proxy.

Example usage:

c := &fasthttp.Client{
	Dial: fasthttpproxy.FasthttpSocksDialer("socks5://localhost:9050"),
}

Source Files

http.go proxy_env.go socks5.go

Version
v1.44.0
Published
Jan 10, 2023
Platform
js/wasm
Imports
11 packages
Last checked
3 weeks ago

Tools for package owners.