go-croxy
A headless Go HTTP transport that transparently tunnels requests through CroxyProxy. It automates the session handshake, CSRF token extraction, and server selection logic.
Installation
go get github.com/askmdev/go-croxy
Usage
package main
import (
"fmt"
"io"
"net/http"
"github.com/askmdev/go-croxy"
)
func main() {
// Initialize the client (handles cookies & session automatically)
client := croxy.New()
// Create your request as usual
req, _ := http.NewRequest("GET", "https://api.ipify.org", nil)
// Tunnel it through the proxy
resp, err := client.ProxyRequest(req)
if err != nil {
// If the session dies, you can retry or reset:
// client.Reset()
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Key Features
- Zero Configuration: Handles the complex multi-step handshake automatically.
- Session Persistence: re-uses established sessions for subsequent requests.
- Manual Rotation:
client.Reset() clears cookies to force a new server IP on the next request.