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

22 Replies, 1276 Views

hey, i feel your pain. resty use socks5 proxy is def not easy. i found this Stack Overflow thread that helped me figure it out.

here’s the link: [Stack Overflow](https://example.com). hope it helps!
yo, i had the same issue. resty use socks5 proxy is a bit of a mess. i ended up using a custom dialer and transport, but it’s still kinda hacky.

here’s a quick example:

```go
dialer, _ := proxy.SOCKS5("tcp", "proxyaddress:port", nil, proxy.Direct)
transport := &http.Transport{DialContext: dialer.(proxy.ContextDialer).DialContext}
client := resty.New().SetTransport(transport)
```

hope this helps!



Users browsing this thread: 1 Guest(s)