diff options
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r-- | netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 3 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java | 25 |
2 files changed, 16 insertions, 12 deletions
diff --git a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java index 25aab36..e6f1ff1 100644 --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java @@ -129,7 +129,10 @@ public final class DeploymentConfiguration { /** the proxy type. possible values are {@code JNLPProxySelector.PROXY_TYPE_*} */ public static final String KEY_PROXY_TYPE = "deployment.proxy.type"; + + /** Boolean. If true, the http host/port should be used for https and ftp as well */ public static final String KEY_PROXY_SAME = "deployment.proxy.same"; + public static final String KEY_PROXY_AUTO_CONFIG_URL = "deployment.proxy.auto.config.url"; public static final String KEY_PROXY_BYPASS_LIST = "deployment.proxy.bypass.list"; public static final String KEY_PROXY_BYPASS_LOCAL = "deployment.proxy.bypass.local"; diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java b/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java index b8fd25d..efcf62e 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java @@ -298,27 +298,28 @@ public abstract class JNLPProxySelector extends ProxySelector { String scheme = uri.getScheme(); if (sameProxy) { - SocketAddress sa = new InetSocketAddress(proxyHttpHost, proxyHttpPort); - Proxy proxy; - if (scheme.equals("socket")) { - proxy = new Proxy(Type.SOCKS, sa); - } else { - proxy = new Proxy(Type.HTTP, sa); + if (proxyHttpHost != null && (scheme.equals("https") || scheme.equals("http") || scheme.equals("ftp"))) { + SocketAddress sa = new InetSocketAddress(proxyHttpHost, proxyHttpPort); + Proxy proxy = new Proxy(Type.HTTP, sa); + proxies.add(proxy); } - proxies.add(proxy); - } else if (scheme.equals("http")) { + } else if (scheme.equals("http") && proxyHttpHost != null) { SocketAddress sa = new InetSocketAddress(proxyHttpHost, proxyHttpPort); proxies.add(new Proxy(Type.HTTP, sa)); - } else if (scheme.equals("https")) { + } else if (scheme.equals("https") && proxyHttpsHost != null) { SocketAddress sa = new InetSocketAddress(proxyHttpsHost, proxyHttpsPort); proxies.add(new Proxy(Type.HTTP, sa)); - } else if (scheme.equals("ftp")) { + } else if (scheme.equals("ftp") && proxyFtpHost != null) { SocketAddress sa = new InetSocketAddress(proxyFtpHost, proxyFtpPort); proxies.add(new Proxy(Type.HTTP, sa)); - } else if (scheme.equals("socket")) { + } + + if (proxySocks4Host != null) { SocketAddress sa = new InetSocketAddress(proxySocks4Host, proxySocks4Port); proxies.add(new Proxy(Type.SOCKS, sa)); - } else { + } + + if (proxies.size() == 0) { proxies.add(Proxy.NO_PROXY); } |