How to configure resty to use a SOCKS5 proxy for API requests?

22 Replies, 1274 Views

Hey, I’ve been there too! For resty use socks5 proxy, I found that setting up a custom HTTP client with the proxy settings first, then passing it to resty, works pretty well.

Here’s a quick example:

```go
proxyURL, _ := url.Parse("socks5://proxyaddress:port")
transport := &http.Transport{Proxy: http.ProxyURL(proxyURL)}
client := resty.New().SetTransport(transport)
```

Hope this helps!

Messages In This Thread



Users browsing this thread: 1 Guest(s)