aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp
diff options
context:
space:
mode:
authorOmair Majid <[email protected]>2013-09-24 13:42:31 -0400
committerOmair Majid <[email protected]>2013-09-24 13:42:31 -0400
commitfcd5c4c69fc5ea84b04f309eb40e295eab921fd8 (patch)
tree3bed81f2b2be0c9b7ac4148605a22c0d75dc9c3d /netx/net/sourceforge/jnlp
parent0b4378d462bf9e44afe71d8c87adf682dd116c50 (diff)
PR1474: Can't get javaws to use SOCKS proxy
If there is a SOCKS proxy specified, use it for https, http, and ftp protocols too (as a fallback). 'sameProxy' now affects the https, http and ftp protocols, but not the socket protocol.
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r--netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java3
-rw-r--r--netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java25
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);
}