Skip to content

Proxy Checker supports the three most commonly used proxy protocols: HTTP, SOCKS4, and SOCKS5, With Proxy Checker, you can easily validate the functionality and availability of proxies.

License

Notifications You must be signed in to change notification settings

trananhtung/proxy-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proxy Checker

The proxy_checker package provides a library for checking the availability of proxies (HTTP, HTTPS, SOCKS4, SOCKS5).

Installation

To use this library, you need to have Go installed and set up your Go workspace.

Run the following command to install the proxy_checker package:

go get github.com/trananhtung/proxy_checker

Usage

To check the availability of a proxy, use the ProxyTest function. It performs a test request to the specified target URL using the provided proxy.

import (
	"fmt"
	"github.com/trananhtung/proxy_checker"
)

func main() {
	proxy := "http://1.1.1.1:8080"
	targetURL := "http://example.com"
	timeout := uint(5) // Timeout in seconds

	result := proxy_checker.ProxyTest(proxy, targetURL, timeout)

	if result {
		fmt.Println("Proxy is available")
	} else {
		fmt.Println("Proxy is not available")
	}
}

Function Documentation

func ProxyTest

func ProxyTest(proxy, urlTarget string, timeout uint) bool

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.

Parameters:

  • proxy: The proxy URL in the format http://:, https://:, socks4://:, socks5://:.
  • urlTarget: The target URL to send the test request to.
  • timeout: The timeout duration in seconds for the test request.

About

Proxy Checker supports the three most commonly used proxy protocols: HTTP, SOCKS4, and SOCKS5, With Proxy Checker, you can easily validate the functionality and availability of proxies.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages