Proxy Community
How to configure resty to use a SOCKS5 proxy for API requests? - Printable Version

+- Proxy Community (https://proxycommunity.com/forum)
+-- Forum: Proxy Types (https://proxycommunity.com/forum/forum-proxy-types)
+--- Forum: SOCKS5 Proxies (https://proxycommunity.com/forum/forum-socks5-proxies)
+--- Thread: How to configure resty to use a SOCKS5 proxy for API requests? (/thread-how-to-configure-resty-to-use-a-socks5-proxy-for-api-requests)

Pages: 1 2 3


“” - phantomCircuitX - 18-03-2025

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!


“” - fastLurk77 - 18-03-2025

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!