Setting proxy config with command line

Hello !

I’m trying to use SNAP by calling it with command line in a python script and in order to use “DEM AUTODOWNLOAD” I need to set proxy parameters by using command lines and not graphic interface but I didn’t see anything saying it is possible.

My best regards

At the bottom of this page it is described how to do it:
https://senbox.atlassian.net/wiki/spaces/SNAP/pages/30539785/Update+SNAP+from+the+command+line
I’ve not worked with these settings myself. Because I don’t need proxy settings. So I’m not absolutely sure if this works.

Thanks for your response,

Actually, it does not work but we’re not sure about why it doesn’t :frowning:

Do you know if it’s also in the core.properties file that the binary file gpt is taking proxy setting when running for an Autodownload or does it has its own setting file ?

My best regards

Actually, it should be used automatically, after it has been configured via NetBeans.
You could try to add the proxy settings as system properties, either to gpt.vmoptions in the bin directory or tosnap.conf in the etc directory of the SNAP installation folder. Depending on what you call.
This page might help.
https://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
Sorry for not being more helpful. I’m not very familiar with these proxy settings.

Add this to $SNAP/bin/gpt.options ($SNAP is the directory where snap is installed)

-Dhttp.proxyHost=http.proxy.ip
-Dhttp.proxyPort=NNNN
-Dhttps.proxyHost=https.proxy.ip
-Dhttps.proxyPort=MMMM

where http(s).proxy.ip is the IP address of your proxy server and NNNN, MMMM their respective ports.

Check you system set up to discover proxy settings, i.e. via:

echo $http_proxy

1 Like