Snapd behind Socks proxy


Is it possible to run snap behind a socks proxy.

I see how to use an http proxy, but socks proxy doesn’t seem to work.

Thank you

Can you be more specific? Do you mean a snap application, eg. spotify or the snapd daemon and snap command that interacts with it?

I was talking of the snapd daemon and the snap command that interacts with it.

My all_proxy command is set up as such :
export all_proxy=socks5h://
It works for many Linux tools (such as curl for example)

I need both the http/https calls to be proxified as well as the DNS calls (which are UDPs).

For the moment, I haven’t been able to use snap on my machine.

Thank you very much for your help !

snapd supports whatever the go net/http client supports, see Skimming the documentation, I don’t see any mention of all_proxy, so most likely it’s not used, however, you can set HTTP_PROXY and HTTPS_PROXY to socks5://<host>:<port>/ in snapd environment and give it a try.

I suggest you do systemctl edit snapd.service and then in the editor window paste this:


Next run systemctl restart snapd.service and try to install a snap.

Hello Maciej

Thank you for your response. But unfortunately, I tried and it doesn’t work.

It is possible that the protocol socks5:// is supported. But the protocol socks5h:// is not…

In my corporate environment, we don’t have a direct access to the DNS (for security reasons). All calls to the DNS server have to go through the proxy.

Would you see any other option for me ?

Thank you very much !

I don’t think there’s any other solution available at the moment. Can you file a bug about missing socks5h support at ?

This is done :

Thank you very much !

1 Like