This package distributes requests through a pool of proxies, acting as a proxy gateway that supports CONNECT requests. Proxy rotation spreads out usage as much as possible to avoid IP bans or restrictions. The gateway only accepts proxy urls with the https scheme.
go get -u github.com/aidenesco/connectLoading proxies
import "github.com/aidenesco/connect"
func main() {
pool := connect.NewPool()
proxyUrl, _ := url.Parse("https://username:password@host:port")
_ = pool.AddProxy(proxyUrl)Server
import "github.com/aidenesco/connect"
func main() {
pool := connect.NewPool()
//Load pool with your proxies
server := &http.Server{
Addr: ":443",
Handler: http.HandlerFunc(pool.Serve),
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)),
}
log.Fatal(server.ListenAndServeTLS("your-cert", "your-key"))
}