https://github.com/imthaghost/merrygoround
Example of how to build a HTTP Client with rotating IPs
https://github.com/imthaghost/merrygoround
go golang http-client tor
Last synced: over 1 year ago
JSON representation
Example of how to build a HTTP Client with rotating IPs
- Host: GitHub
- URL: https://github.com/imthaghost/merrygoround
- Owner: imthaghost
- Created: 2021-06-06T18:09:20.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-29T15:33:57.000Z (over 3 years ago)
- Last Synced: 2025-03-26T06:34:36.397Z (over 1 year ago)
- Topics: go, golang, http-client, tor
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 6
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# merryGoRound
[](https://pkg.go.dev/github.com/tempor1s/notiongo)
[](https://github.com/google/go-github/actions?query=workflow%3Atests)
[](https://codecov.io/gh/google/go-github)
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:
```bash
go get github.com/imthaghost/merrygoround/
```
will resolve and add the package to the current development module, along with its dependencies.
## Usage ##
```go
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)
}
```