diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelTCP.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelTCP.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelTCP.java index 1920726d7..564a18d38 100644 --- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelTCP.java +++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelTCP.java @@ -37,6 +37,8 @@ public class ChannelTCP extends StreamChannel { private boolean started; private boolean closed; + private static boolean use_proxy_settings = true; + private static SSLContext ssl_context; public static void setSSLContext(SSLContext ssl_context) { @@ -44,6 +46,17 @@ public class ChannelTCP extends StreamChannel { } /** + * Globally configures the usage of proxy settings + * + * @param use_proxy {@code false} to force no usage of proxy settings by setting the + * java.net.Proxy.NO_PROXY flag while socket creation, {@code true} to use + * the default behavior (use proxy settings when available) + */ + public static void setUseProxySettings(boolean use_proxy) { + ChannelTCP.use_proxy_settings = use_proxy; + } + + /** * Main constructor of ChannelTCP * @param remote_peer Remote Peer to which we want to connect * @param host Hostname or IP Address of the Remote Peer @@ -52,7 +65,7 @@ public class ChannelTCP extends StreamChannel { */ public ChannelTCP(IPeer remote_peer, final String host, final int port, final boolean ssl) { super(remote_peer); - socket = new Socket(); + socket = use_proxy_settings ? new Socket() : new Socket(java.net.Proxy.NO_PROXY); Protocol.invokeLater(new Runnable() { public void run() { Thread thread = new Thread() { |