ScottDaniels / carrousel

Fork of imthaghost merry-go-round to work round a module path bug

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

merryGoRound

GoDoc Test Status Test Coverage

merryGoRound is a simple HTTP Client with rotating IPs via SmartProxy or Tor.

Installation

merryGoRound is compatible with modern Go releases in module mode, with Go installed:

go get github.com/imthaghost/merrygoround/

will resolve and add the package to the current development module, along with its dependencies.

Usage

package main

import (
	"io/ioutil"
	"log"
	"time"
	"log"
	
	ht "github.com/imthaghost/merryGoRound/pkg/http"
)

func main() {
	// Configure a tor client
	tor := ht.Tor{
		MaxTimeout:         20 * time.Second,
		MaxIdleConnections: 10,
	}

	// new instance of tor client
	torClient := tor.New()

	// check your IP with AWS
	res, _ := torClient.Get("https://checkip.amazonaws.com")
	
	body, _ := ioutil.ReadAll(res.Body)
	ip := string(body)
	
	log.Printf("IP: %s", ip)
	
}

About

Fork of imthaghost merry-go-round to work round a module path bug


Languages

Language:Go 97.5%Language:Shell 2.5%