gogetfp

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 8 Imported by: 1

README

gogetfp

gogetfp (Go Get Free Proxy) is a lightweight Go library facilitating the retrieval of free proxies for seamless integration into your applications. With support for popular proxy sources like free-proxy-list.net, sslproxies.org and us-proxy.org. gogetfp offers customizable options, including country filtering and timeout settings. Enhance privacy, security, and access geo-restricted content effortlessly, making 'gogetfp' the go-to solution for integrating free proxies into your Go projects.

Heavily inspired by the Python library freeproxy.

🚀 Installation

Run the following command to install the latest version:

go install -v github.com/groundsec/gogetfp@latest

After this command gogetfp library source will be in your current go.mod.

⚙️ Options

The options are basically the same provided by freeproxy:

Name Type Example Default value
CountryID []string ['US', 'BR'] []string{}
Timeout float64 0.1 1
Random bool True False
Anonym bool True False
Elite bool True False
Google bool False False
HTTPS bool True False

💡 Example

package main

import (
	"fmt"
	"io"
	"log"
	"net/http"

	"github.com/groundsec/gogetfp"
)

func main() {
	fp := gogetfp.New(gogetfp.FreeProxyConfig{})

	proxy, err := fp.GetWorkingProxy()
	if err != nil {
		fmt.Println("Error:", err)
	} else {
		fmt.Println("Working Proxy:", proxy)
	}
}

🪪 License

gogetfp is made with 🖤 by the GroundSec team and released under the MIT LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FreeProxy

type FreeProxy struct {
	Config FreeProxyConfig
}

func New

func New(config FreeProxyConfig) *FreeProxy

func (*FreeProxy) GetProxy

func (fp *FreeProxy) GetProxy() (string, error)

Returns a untested proxy that matches the specified parameters.

func (*FreeProxy) GetProxyList

func (fp *FreeProxy) GetProxyList() ([]string, error)

GetProxyList retrieves a list of proxies based on the specified criteria.

func (*FreeProxy) GetWorkingProxy

func (fp *FreeProxy) GetWorkingProxy() (string, error)

Returns a working proxy that matches the specified parameters.

type FreeProxyConfig

type FreeProxyConfig struct {
	CountryID []string
	Timeout   float64
	Random    bool
	Anonym    bool
	Elite     bool
	Google    bool
	HTTPS     bool
}

FreeProxy struct defines the parameters for scraping and checking proxies.

Jump to

Keyboard shortcuts

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