yccheok / jstock

JStock is a free stock market software for 28 countries.
https://jstock.org
660 stars 347 forks source link

Honour launch -Dhttp.proxyHost etc. unless overridden in config #91

Open javabrett opened 7 years ago

javabrett commented 7 years ago

Currently, initJStockOptions does this:

if ((proxyHost.length() > 0) && (org.yccheok.jstock.engine.Utils.isValidPortNumber(proxyPort))) {
    System.getProperties().put("http.proxyHost", proxyHost);
    System.getProperties().put("http.proxyPort", "" + proxyPort);
} else {
    System.getProperties().remove("http.proxyHost");
    System.getProperties().remove("http.proxyPort");
}

The net result is that you can't pre-determine the proxy settings at launch-time using sysprops - you are forced to use the configuration panel. These props are pretty standard for Java-based kit - we should allow them to be used, and only replace them if the user then explicitly changes the settings in the config UI. It could be argued that you shouldn't even be able to nullify them there - they should be removed from the calling script if that is the aim.

In other words, I want to be able to set these in jstock.sh _VMOPTIONS.

Curiously, for outbound https (Google auth API) I can do that using the https variants, see #86 .