gbPool

package module
v0.0.0-...-c7aff9a Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: GPL-2.0 Imports: 0 Imported by: 0

README

GBPool-- a simple but useful golang free proxy pool

Intro(English) (中文)

GBPool, golang BaiPiao(completely free) proxy pool, a free & simple golang proxy pool module, gathering proxies from all kindness free proxy provider.Developed for individual use, but you can apply it anywhere you want.
Thanks(also if my project is affecting your service, please post an issue, and we will remove your service immediately.)
What can it do?
  • Switch different proxy
  • Easy to implement your own provider
  • Support manually enable | disable manager
  • Support custom process to a proxy(drop | reuse | expired, you can also implement your own process)
  • More and more coming soon with your help.
Install
1.Simply add this line below to your go.mod
github.com/jobber2955/gbPool latest
2.Copy proxy_pool.yaml.example to the root of your project(of course you can also edit your own config file referring to the existing example file. NOTICE: if you choose to use your own config file, remember to edit the init function in /pool/pool.go)
3.!!!Remember using the correct proxy config!!!
Example(Config for each type of manager's fetcher is down below)
import (
    "fmt"
    "github.com/jobber2955/gbPool/pool"
    "github.com/jobber2955/gbPool/public"
    "time"
)

func main() {
    proxyPool := pool.NewProxyPool(30)
    err := proxyPool.NewManager("ihuan", &public.IHuanConfig{
    Num:         "30",
    Anonymity:   "",
    Type:        "",
    Post:        "",
    Sort:        "",
    Port:        "",
    KillPort:    "",
    Address:     "",
    Key:         "",
    KillAddress: "",
    })
    if err != nil {
        return
    }
    for {
        fmt.Println(<- proxyPool.ProxyChan)
        time.Sleep(time.Second)
    }
}
Config Type
  • iHuan
Name Type Meaning Value Example Comment
Num string number of proxy to get each time 10 iHuan use form to post rather than RESTful API. Needs to have an empty value of each key(same as nil, but for types like int, their default "ZERO VALUE" is 0, so just use string for simple)
Anonymity string Level of the proxy's anonymity 0:Transparent proxy
1:Normal proxy
2:High anonymity proxy
empty: All
Type string HTTPS || HTTP 0:HTTP only
1:HTTPS only
empty: All
Post string Support Post method 1:Support
empty: All
Sort string Sorting Type 1:Validate time nearest first
2:Validate time farthest first
3:Alive duration shortest first
4:Alive duration longest first
empty: Random
Port string Specific port 8080(only 1 port supported)
KillPort string Specific exclude port 8080(only 1 port supported)
Address string Specific Address 中国/美国(only one support, not sure about non-simplified-chinese words)
KillAddress string Specific exclude Address 中国/美国(only one support, not sure about non-simplified-chinese words)
Key string iHuan post validation key You don't have to specify this
Things that you need to know
  • This is a personally developed module, the main purpose is to help people get a more stable & anonymous way to gather the data they need.
  • This module is not for abruptly annoying or even attack those free proxy providers. In contrary, I hope this package can reduce the pressure for them, as this project is more steerable & less request.
  • Please be known this is a personal & individual work, some problem may not be answered or solved immediately. Welcome to contribute!
  • Using this project is on your own responsibility, any consequence is yours.
  • I'm quite a noob in programming, so if you have any bug | suggestion, please let me know in the issue.
TODO
  • Maybe change config file to variable when create new manager.(already changed, and no longer use logger, now we use errors)
  • Support more provider
  • Specify the description of function
  • Maybe I should change all the public struct(like &IhuanConfig) to the root directory?

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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