# Recommendations for SOCKS5 proxy services as cloud gateway

**URL:** <https://forums.balena.io/t/recommendations-for-socks5-proxy-services-as-cloud-gateway/177207>\
**Category:** General\
**Tags:** network\
**Created:** [August 24, 2020, 9:12pm UTC](https://forums.balena.io/t/recommendations-for-socks5-proxy-services-as-cloud-gateway/177207 "2020-08-24T21:12:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nebbles](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nebbles](https://forums.balena.io/u/nebbles)\
**Post date:** [August 24, 2020, 9:12pm UTC](https://forums.balena.io/t/recommendations-for-socks5-proxy-services-as-cloud-gateway/177207/1 "2020-08-24T21:12:15Z")

</div>

I’m currently researching for a way to route all traffic from a Balena device through a proxy. The thread here raised an interesting approach as well as some very relevant questions - routing all traffic through a proxy…

> [@Any exceptions when routing through a proxy](https://forums.balena.io/t/any-exceptions-when-routing-through-a-proxy/64021/19):
>
> I have recently came accross [shadowsocks](https://github.com/shadowsocks/shadowsocks-libev) which seems to [support transparent udp/tcp proxying](https://shadowsocks.org/en/spec/Protocol.html). It would be great if shadowsocks could be integrated to balena-os as an alternative to redsocks.

Generally speaking, though I am interested if there are any recommendations on how to get production/scalable SOCKS5 proxy on the cloud side. The purpose is to route all traffic from a Balena device to a single IP address (with white label domain) on a single port and have that proxy relay requests to the wider internet.

These devices need to be deployed behind restrictive firewalls where we have to negotiate our access to the wider internet. Our job would be made much easier if we could ask for all traffic to a single external IP address to be placed on the allowlist.

Are there any method - or even better, SaaS products - that offer this sort of service that you’d recommend?

- static reserved IP address to connect to proxy via single port
- white label domain on reserved IP
- authentication & logging

---

<div class="post-metadata">

**Author:** ![jimsynz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jimsynz/32/4663_2.png) [@jimsynz](https://forums.balena.io/u/jimsynz)\
**Post date:** [August 24, 2020, 9:22pm UTC](https://forums.balena.io/t/recommendations-for-socks5-proxy-services-as-cloud-gateway/177207/4 "2020-08-24T21:22:08Z")

</div>

Hi @nebbles, welcome to the Balena forums.

I’m not sure exactly about using a socks proxy, but have you considered using a VPN? balenaOS already has openvpn installed (we use it for our management VPN) and I _think_ it should be possible to create network manager connection file that does this.

Hope that helps.

James.

---

<div class="post-metadata">

**Author:** ![nebbles](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nebbles](https://forums.balena.io/u/nebbles)\
**Post date:** [August 24, 2020, 9:42pm UTC](https://forums.balena.io/t/recommendations-for-socks5-proxy-services-as-cloud-gateway/177207/5 "2020-08-24T21:42:35Z")

</div>

Hi James, thanks for the quick response. Would consider a VPN, our concern would be scaling it to multiple devices. Perhaps you could provide some insight on how you handle so many VPN connections to IOT devices through a single host?

The thought of the proxy was a lightweight middleman for directing all outbound traffic from the Balena Device through a single point. I had seen [Network Setup on balenaOS - Balena Documentation](https://www.balena.io/docs/reference/OS/network/2.x/#connecting-behind-a-proxy) and had the belief that this was going to be the only way to manage all traffic from a Device.

This thread specifically didn’t give me much hope for the VPN approach:

> [@Feature Request: option to tunnel ALL traffic through a private VPN](https://forums.balena.io/t/feature-request-option-to-tunnel-all-traffic-through-a-private-vpn/1221/7):
>
> Hi @imrehg, thanks for the quick response. Out of curiosity I checked the above mentioned pull request in meta-resin (618) and it looks like it is already available in the current ResinOS image (Resin OS 2.0.8+rev1 (prod)). Is that correct? At first sight everything seems to be working, so we will already test everything thoroughly wink Anything I should keep in mind when testing? Keep up the good work guys!

---

<div class="post-metadata">

**Author:** ![robertgzr](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/robertgzr/32/1387_2.png) [@robertgzr](https://forums.balena.io/u/robertgzr)\
**Post date:** [August 26, 2020, 10:09am UTC](https://forums.balena.io/t/recommendations-for-socks5-proxy-services-as-cloud-gateway/177207/10 "2020-08-26T10:09:23Z")

</div>

I think the socks documentation is the right direction for you here. In regards to scaling that on the cloud side: going via a loadbalancer should allow you to handle a fair number of connections by allowing you to have potentially multiple machines act as proxies

---

<div class="post-metadata">

**Author:** ![robertgzr](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/robertgzr/32/1387_2.png) [@robertgzr](https://forums.balena.io/u/robertgzr)\
**Post date:** [August 26, 2020, 10:10am UTC](https://forums.balena.io/t/recommendations-for-socks5-proxy-services-as-cloud-gateway/177207/11 "2020-08-26T10:10:23Z")

</div>

please do share any obstacles you encounter while implementing your solution. we’re always looking out to remove those for you where we can 🙂
