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

22 Replies, 1714 Views

Hey! I had the same issue with resty use socks5 proxy. Honestly, the docs are kinda vague, but I managed to get it working by using a custom dialer. Here’s a snippet:

```go
dialer := proxy.FromEnvironment()
transport := &http.Transport{DialContext: dialer.DialContext}
client := resty.New().SetTransport(transport)
```

It’s not the cleanest, but it works. Let me know if you need more details!

Messages In This Thread



Users browsing this thread: 1 Guest(s)