How to permanently set proxy in Snap?

Snap store is blocked by ISP so I have to connect through proxy.

I tried to use following commands to set proxy:

sudo snap set system proxy.https="socks5://ip:port"
sudo snap set system proxy.https="socks5://ip:port"
sudo snap set system proxy.https="socks5://ip:port"

Then I run:

snap install %package_name%

Package gets downloaded, then following message shows:

%datetime% INFO Waiting for automatic snapd restart...
Automatically connect eligible plugs and slots of snap "%package_name%"

Then it takes forever. When I manually stop the process (ctrl+c), then I run following commands, it seems that proxy configurations are automatically cleared (maybe because of “automatic snapd restart”?).

sudo snap get system proxy.http
sudo snap get system proxy.https
sudo snap get system proxy.ftp

Then I need to re-configure proxy and repeat the process, which unfortunately ends up to same result again.

How can I set proxy configurations permanently in Snap? I’m new to Snap and it’s my first attempt to use it. I tried on both Ubuntu and CentOS with no success.