|
|
|
@ -48,10 +48,10 @@ public final class ProxySettings {
|
|
|
|
|
private static final Object PRESENT = new Object();
|
|
|
|
|
|
|
|
|
|
public static enum Protocol {
|
|
|
|
|
HTTP, HTTPS, YACY
|
|
|
|
|
HTTP, HTTPS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static boolean use = false, use4YaCy = false, use4ssl = false;
|
|
|
|
|
private static boolean use = false, use4ssl = false;
|
|
|
|
|
public static String host = null, user = "", password = "";
|
|
|
|
|
public static int port = 0;
|
|
|
|
|
public static String[] noProxy = null;
|
|
|
|
@ -64,9 +64,6 @@ public final class ProxySettings {
|
|
|
|
|
public static void setProxyUse4HTTPS(boolean use4https0) {
|
|
|
|
|
use4ssl = use4https0;
|
|
|
|
|
}
|
|
|
|
|
public static void setProxyUse4YaCy(boolean use4YaCy0) {
|
|
|
|
|
use4YaCy = use4YaCy0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
@ -117,7 +114,6 @@ public final class ProxySettings {
|
|
|
|
|
assert protocol != null;
|
|
|
|
|
if (!use) return false;
|
|
|
|
|
if (protocol == Protocol.HTTPS && !use4ssl) return false;
|
|
|
|
|
if (protocol == Protocol.YACY && !use4YaCy) return false;
|
|
|
|
|
if (allowProxy.containsKey(host)) return true;
|
|
|
|
|
if (disallowProxy.containsKey(host)) return false;
|
|
|
|
|
for (String pattern: noProxy) {
|
|
|
|
|