tss/exp/proxy/main.go
2022-05-02 11:36:24 -04:00

28 lines
468 B
Go

package main
import (
"fmt"
"io"
"log"
"net/http"
"go.balki.me/tss/proxy"
)
func main() {
trans, err := proxy.GetTransport("socks5://unix/run/tor/socks")
client := &http.Client{
Transport: trans,
}
res, err := client.Get("https://ip.balki.me")
if err != nil {
log.Panicln(err)
}
data, err := io.ReadAll(res.Body)
if err != nil {
log.Panicln(err)
}
fmt.Printf("status: %v, data: %s\n", res.Status, data)
fmt.Printf("%#v\n", client.Transport)
}