Skip to content

Commit

Permalink
Add option to ignore all proxies
Browse files Browse the repository at this point in the history
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
  • Loading branch information
snjeza authored and rgrunber committed Jun 14, 2021
1 parent 7ababdf commit f4fad03
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public class JavaLanguageServerPlugin extends Plugin {

private static final String JDT_UI_PLUGIN = "org.eclipse.jdt.ui";
public static final String MANUAL = "Manual";
public static final String DIRECT = "Direct";
public static final String NATIVE = "Native";
public static final String HTTP_NON_PROXY_HOSTS = "http.nonProxyHosts";
public static final String HTTPS_NON_PROXY_HOSTS = "https.nonProxyHosts";
public static final String HTTPS_PROXY_PASSWORD = "https.proxyPassword";
Expand Down Expand Up @@ -259,6 +261,10 @@ private void setPreferenceNodeId() {
}

private void configureProxy() {
if (Boolean.getBoolean("jdt.ls.disableProxies")) {
ProxySelector.setActiveProvider(DIRECT);
return;
}
// It seems there is no way to set a proxy provider type (manual, native or
// direct) without the Eclipse UI.
// The org.eclipse.core.net plugin removes the http., https. system properties
Expand Down Expand Up @@ -343,6 +349,9 @@ public PasswordAuthentication getPasswordAuthentication() {
logException(e.getMessage(), e);
}
}
} else {
ProxySelector.setActiveProvider(NATIVE);
return;
}
}

Expand Down

0 comments on commit f4fad03

Please sign in to comment.