Documentation
¶
Overview ¶
Package proxy_checker provides a library for checking the availability of proxies.
Index ¶
Constants ¶
View Source
const ( // AMAZON_CHECK_IP_URL is the URL used for checking the availability of a proxy. AMAZON_CHECK_IP_URL = "http://checkip.amazonaws.com/" IPINFO_CHECK_IP_URL = "https://ipinfo.io/" )
Variables ¶
This section is empty.
Functions ¶
func ProxyTest ¶
ProxyTest checks the availability of a proxy by performing a test request.
It sends an HTTP GET request to the specified target URL using the provided proxy. The function supports both HTTP and HTTPS proxies. It uses the specified timeout duration for the request.
The function returns true if the proxy is available and the test request succeeds. It returns false if the proxy is unavailable or the test request fails.
Example:
proxy := "http://1.1.1.1:8080" targetURL := "http://example.com" timeout := uint(5) // Timeout in seconds result := ProxyTest(proxy, targetURL, timeout) if result { fmt.Println("Proxy is available") } else { fmt.Println("Proxy is not available") }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.