Skip to content

Commit 580cd45

Browse files
committed
Fix proxy settings
1 parent 44d60a0 commit 580cd45

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

org.gitools.ui.app/src/main/java/org/gitools/ui/app/genomespace/dm/HttpUtils.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,15 @@ private HttpURLConnection openConnection(URL url, Map<String, String> requestPro
443443

444444
private HttpURLConnection openConnection(URL url, Map<String, String> requestProperties, String method, int redirectCount) throws IOException {
445445

446-
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
446+
Object proxyHost = System.getProperties().get("http.proxyHost");
447+
Object proxyPort = System.getProperties().get("http.proxyPort");
447448

449+
Proxy proxy = Proxy.NO_PROXY;
450+
if (proxyHost != null && proxyPort != null && proxyPort instanceof Integer) {
451+
proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost.toString(), (Integer) proxyPort));
452+
}
453+
454+
HttpURLConnection conn = (HttpURLConnection) url.openConnection(proxy);
448455

449456
if (GSUtils.isGenomeSpace(url)) {
450457
String token = GSUtils.getGSToken();

org.gitools.ui.core/src/main/java/org/gitools/ui/core/Application.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ boolean isNewerGitoolsAvailable() throws Exception {
214214
con.setConnectTimeout(1000);
215215
con.setReadTimeout(1000);
216216

217-
BufferedReader in = new BufferedReader(new InputStreamReader(latestUrl.openStream()));
217+
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
218218

219219
String latestVersion;
220220
latestVersion = in.readLine();

0 commit comments

Comments
 (0)