Use new plugin configuration API
This commit is contained in:
parent
3a64f9edaa
commit
c34b5e0fa3
basic-authentication/org/omegazero/proxyplugin/basicauth
cache/org/omegazero/proxyaccelerator/cache
compressor/org/omegazero/proxyaccelerator/compressor
custom-headers/org/omegazero/proxyplugin/customheaders
mirror/org/omegazero/proxyplugin/mirror
no-dns-root/main/java/org/omegazero/proxyplugin/nodnsroot
proxy-resources/org/omegazero/proxyplugin/proxyresources
redirect-http/org/omegazero/proxyplugin/redirectinsecure
server-timing/org/omegazero/proxyplugin/servertiming
virtual-host/org/omegazero/proxyplugin/vhost
x-forwarded-for/org/omegazero/proxyplugin/xforwardedfor
@ -25,7 +25,7 @@ import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.http.util.HTTPStatus;
|
||||
import org.omegazero.net.socket.SocketConnection;
|
||||
import org.omegazero.proxy.http.ProxyHTTPRequest;
|
||||
@ -36,11 +36,12 @@ import org.omegazero.proxyplugin.vhost.VirtualHost;
|
||||
@EventBusSubscriber
|
||||
public class BasicAuthPlugin {
|
||||
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
private static final Logger logger = Logger.create();
|
||||
|
||||
|
||||
private final Map<String, User> users = new HashMap<>();
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
this.users.clear();
|
||||
ConfigArray usersArr = config.optArray("users");
|
||||
|
@ -20,13 +20,14 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.omegazero.common.config.ConfigObject;
|
||||
import org.omegazero.common.config.ConfigurationOption;
|
||||
import org.omegazero.common.event.Tasks;
|
||||
import org.omegazero.common.eventbus.Event;
|
||||
import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.http.common.HTTPMessage;
|
||||
import org.omegazero.http.common.HTTPRequest;
|
||||
import org.omegazero.http.common.HTTPResponse;
|
||||
@ -42,7 +43,7 @@ import org.omegazero.proxyaccelerator.cache.integration.VHostIntegration;
|
||||
@EventBusSubscriber
|
||||
public class CachePlugin {
|
||||
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
private static final Logger logger = Logger.create();
|
||||
|
||||
private static Map<String, Supplier<ResourceCache>> cacheTypes = new ConcurrentHashMap<>();
|
||||
private static Map<String, VaryComparator> varyComparators = new ConcurrentHashMap<>();
|
||||
@ -58,15 +59,21 @@ public class CachePlugin {
|
||||
private CacheConfig cacheConfig;
|
||||
private VHostIntegration pluginVhost;
|
||||
|
||||
private String cacheName;
|
||||
private boolean appendCacheName;
|
||||
private String cacheServedByPrefix;
|
||||
private String cacheType;
|
||||
private long cacheLimit;
|
||||
@ConfigurationOption
|
||||
private String name = null;
|
||||
@ConfigurationOption
|
||||
private boolean appendCacheName = false;
|
||||
@ConfigurationOption
|
||||
private String servedByPrefix = "cache-";
|
||||
@ConfigurationOption
|
||||
private String type = "lru";
|
||||
@ConfigurationOption
|
||||
private long sizeLimit = (long) (Runtime.getRuntime().maxMemory() * 0.5f);
|
||||
|
||||
private ResourceCache cache;
|
||||
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
this.cacheConfig = CacheConfig.from(config, null);
|
||||
|
||||
@ -76,12 +83,6 @@ public class CachePlugin {
|
||||
}else if(this.pluginVhost != null)
|
||||
this.pluginVhost.invalidate();
|
||||
|
||||
this.cacheName = config.optString("name", null);
|
||||
this.appendCacheName = config.optBoolean("appendCacheName", false);
|
||||
this.cacheServedByPrefix = config.optString("servedByPrefix", "cache-");
|
||||
this.cacheType = config.optString("type", "lru");
|
||||
this.cacheLimit = config.optLong("sizeLimit", (long) (Runtime.getRuntime().maxMemory() * 0.5f));
|
||||
|
||||
if(this.cache != null) // dont create cache on plugin init (done in onInit instead)
|
||||
this.reloadCache();
|
||||
}
|
||||
@ -90,7 +91,7 @@ public class CachePlugin {
|
||||
@SubscribeEvent
|
||||
public void onPreinit() {
|
||||
if(this.appendCacheName)
|
||||
Proxy.getInstance().setInstanceNameAppendage(this.cacheName);
|
||||
Proxy.getInstance().setInstanceNameAppendage(this.name);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@ -242,8 +243,8 @@ public class CachePlugin {
|
||||
|
||||
private void purgeReply(HTTPRequest request, int status, String statusmsg, String additional) {
|
||||
String resJson = "{\"status\":\"" + statusmsg + "\"";
|
||||
if(this.cacheName != null)
|
||||
resJson += ",\"server\":\"" + this.cacheServedByPrefix + this.cacheName + "\"";
|
||||
if(this.name != null)
|
||||
resJson += ",\"server\":\"" + this.servedByPrefix + this.name + "\"";
|
||||
if(additional != null)
|
||||
resJson += additional;
|
||||
resJson += "}";
|
||||
@ -275,8 +276,8 @@ public class CachePlugin {
|
||||
msg.appendHeader("x-cache", hit ? "HIT" : "MISS", ", ");
|
||||
msg.appendHeader("x-cache-lookup", entry != null ? "HIT" : "MISS", ", ");
|
||||
msg.appendHeader("x-cache-hits", entry != null ? String.valueOf(entry.getHits()) : "0", ", ");
|
||||
if(this.cacheName != null)
|
||||
msg.appendHeader("x-served-by", this.cacheServedByPrefix + this.cacheName, ", ");
|
||||
if(this.name != null)
|
||||
msg.appendHeader("x-served-by", this.servedByPrefix + this.name, ", ");
|
||||
}
|
||||
|
||||
private CacheConfig getConfig(UpstreamServer userver) {
|
||||
@ -312,11 +313,11 @@ public class CachePlugin {
|
||||
if(this.cache != null)
|
||||
this.cache.close();
|
||||
|
||||
Supplier<ResourceCache> supplier = CachePlugin.cacheTypes.get(this.cacheType);
|
||||
Supplier<ResourceCache> supplier = CachePlugin.cacheTypes.get(this.type);
|
||||
if(supplier == null)
|
||||
throw new IllegalArgumentException("Invalid cache type '" + this.cacheType + "'");
|
||||
throw new IllegalArgumentException("Invalid cache type '" + this.type + "'");
|
||||
this.cache = supplier.get();
|
||||
this.cache.setMaxCacheSize(this.cacheLimit);
|
||||
this.cache.setMaxCacheSize(this.sizeLimit);
|
||||
|
||||
logger.debug("Initialized cache type ", this.cache.getClass().getName());
|
||||
}
|
||||
|
@ -20,11 +20,11 @@ import java.util.function.Supplier;
|
||||
|
||||
import org.omegazero.common.config.ConfigArray;
|
||||
import org.omegazero.common.config.ConfigObject;
|
||||
import org.omegazero.common.config.ConfigurationOption;
|
||||
import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.http.common.HTTPRequest;
|
||||
import org.omegazero.http.common.HTTPResponse;
|
||||
import org.omegazero.http.common.HTTPResponseData;
|
||||
@ -37,31 +37,19 @@ import org.omegazero.proxyaccelerator.cache.VaryComparator;
|
||||
@EventBusSubscriber
|
||||
public class CompressorPlugin {
|
||||
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
private static final Logger logger = Logger.create();
|
||||
|
||||
private static Map<String, Supplier<Compressor>> compressors = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
@ConfigurationOption
|
||||
private List<String> enabledMimeTypes = new ArrayList<>();
|
||||
private String preferredCompressor;
|
||||
private boolean onlyIfChunked;
|
||||
private boolean onlyIfNoEncoding;
|
||||
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
this.enabledMimeTypes.clear();
|
||||
|
||||
ConfigArray enabledMimeTypesArr = config.optArray("enabledMimeTypes");
|
||||
if(enabledMimeTypesArr != null){
|
||||
for(Object o : enabledMimeTypesArr){
|
||||
if(!(o instanceof String))
|
||||
throw new IllegalArgumentException("Values in 'enabledMimeTypes' must be strings");
|
||||
this.enabledMimeTypes.add((String) o);
|
||||
}
|
||||
}
|
||||
this.preferredCompressor = config.optString("preferredCompressor", null);
|
||||
this.onlyIfChunked = config.optBoolean("onlyIfChunked", false);
|
||||
this.onlyIfNoEncoding = config.optBoolean("onlyIfNoEncoding", true);
|
||||
}
|
||||
@ConfigurationOption
|
||||
private String preferredCompressor = null;
|
||||
@ConfigurationOption
|
||||
private boolean onlyIfChunked = false;
|
||||
@ConfigurationOption
|
||||
private boolean onlyIfNoEncoding = true;
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
|
@ -23,7 +23,7 @@ import org.omegazero.common.config.ConfigObject;
|
||||
import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.http.common.HTTPMessage;
|
||||
import org.omegazero.http.common.HTTPRequest;
|
||||
import org.omegazero.http.common.HTTPResponse;
|
||||
@ -35,13 +35,14 @@ import org.omegazero.proxy.util.ProxyUtil;
|
||||
@EventBusSubscriber
|
||||
public class CustomHeadersPlugin {
|
||||
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
private static final Logger logger = Logger.create();
|
||||
|
||||
|
||||
private final List<Host> hosts = new ArrayList<>();
|
||||
|
||||
private VHostIntegration pluginVhost;
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
this.hosts.clear();
|
||||
for(String hostname : config.keySet()){
|
||||
|
@ -20,7 +20,7 @@ import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.http.common.HTTPResponse;
|
||||
import org.omegazero.http.common.HTTPResponseData;
|
||||
import org.omegazero.net.socket.SocketConnection;
|
||||
@ -33,11 +33,12 @@ import org.omegazero.proxyplugin.mirror.transformer.PathTransformer;
|
||||
@EventBusSubscriber
|
||||
public class MirrorPlugin {
|
||||
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
private static final Logger logger = Logger.create();
|
||||
|
||||
|
||||
private List<TransformerEntry> transformers = new ArrayList<>();
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
this.transformers.clear();
|
||||
ConfigArray arr = config.optArray("transformers");
|
||||
|
@ -7,6 +7,7 @@
|
||||
package org.omegazero.proxyplugin.nodnsroot;
|
||||
|
||||
import org.omegazero.common.config.ConfigObject;
|
||||
import org.omegazero.common.config.ConfigurationOption;
|
||||
import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.http.util.HTTPStatus;
|
||||
@ -18,12 +19,9 @@ import org.omegazero.proxy.net.UpstreamServer;
|
||||
public class NoDNSRoot {
|
||||
|
||||
|
||||
@ConfigurationOption
|
||||
private boolean redirectPermanent = false;
|
||||
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
this.redirectPermanent = config.optBoolean("redirectPermanent", false);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent(priority = SubscribeEvent.Priority.HIGHEST)
|
||||
public void onHTTPRequestPre(SocketConnection downstreamConnection, ProxyHTTPRequest request, UpstreamServer userver) {
|
||||
|
@ -26,7 +26,7 @@ import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.http.common.HTTPRequest;
|
||||
import org.omegazero.net.socket.SocketConnection;
|
||||
import org.omegazero.proxy.net.UpstreamServer;
|
||||
@ -35,11 +35,12 @@ import org.omegazero.proxy.util.ProxyUtil;
|
||||
@EventBusSubscriber
|
||||
public class ProxyResourcesPlugin {
|
||||
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
private static final Logger logger = Logger.create();
|
||||
|
||||
|
||||
private List<Resource> resources = new ArrayList<>();
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) throws IOException {
|
||||
this.resources.clear();
|
||||
ConfigArray arr = config.optArray("resources");
|
||||
|
@ -16,6 +16,7 @@ import java.util.List;
|
||||
|
||||
import org.omegazero.common.config.ConfigArray;
|
||||
import org.omegazero.common.config.ConfigObject;
|
||||
import org.omegazero.common.config.ConfigurationOption;
|
||||
import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
@ -32,20 +33,9 @@ public class RedirectInsecurePlugin {
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
|
||||
|
||||
@ConfigurationOption
|
||||
private List<String> hostnames = new ArrayList<>();
|
||||
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
this.hostnames.clear();
|
||||
ConfigArray arr = config.optArray("hostnames");
|
||||
if(arr == null)
|
||||
return;
|
||||
for(Object o : arr){
|
||||
if(!(o instanceof String))
|
||||
throw new IllegalArgumentException("Values in 'hostnames' must be strings");
|
||||
this.hostnames.add((String) o);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent(priority = Priority.HIGHEST)
|
||||
public synchronized void onHTTPRequestPre(SocketConnection downstreamConnection, ProxyHTTPRequest request, UpstreamServer userver) {
|
||||
|
@ -15,10 +15,11 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.omegazero.common.config.ConfigObject;
|
||||
import org.omegazero.common.config.ConfigurationOption;
|
||||
import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.net.socket.SocketConnection;
|
||||
import org.omegazero.proxy.http.ProxyHTTPRequest;
|
||||
import org.omegazero.proxy.http.ProxyHTTPResponse;
|
||||
@ -27,22 +28,22 @@ import org.omegazero.proxy.net.UpstreamServer;
|
||||
@EventBusSubscriber
|
||||
public class ServerTimingPlugin {
|
||||
|
||||
private static final Logger logger = LoggerUtil.createLogger();
|
||||
private static final Logger logger = Logger.create();
|
||||
|
||||
private static final Pattern durPattern = Pattern.compile("dur=[\\-0-9\\.e]+");
|
||||
|
||||
|
||||
@ConfigurationOption
|
||||
private boolean addStart;
|
||||
@ConfigurationOption
|
||||
private boolean subtractOriginTiming;
|
||||
|
||||
private String headerVal;
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
String metricDesc = config.optString("metricDesc", null);
|
||||
String metricName = config.optString("metricName", "proxy-timing");
|
||||
this.addStart = config.optBoolean("addStart", true);
|
||||
this.subtractOriginTiming = config.optBoolean("subtractOriginTiming", true);
|
||||
|
||||
this.headerVal = metricName + (metricDesc != null ? (";desc=\"" + metricDesc + "\"") : "") + ";dur=";
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.http.util.HTTPStatus;
|
||||
import org.omegazero.net.socket.SocketConnection;
|
||||
import org.omegazero.proxy.http.ProxyHTTPRequest;
|
||||
@ -41,6 +42,7 @@ public class VirtualHostPlugin {
|
||||
private Map<String, ConfigObject> templates = new HashMap<>();
|
||||
private VHostNode rootNode;
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) throws UnknownHostException {
|
||||
this.templates.clear();
|
||||
this.rootNode = new VHostNode();
|
||||
|
@ -18,11 +18,13 @@ import java.util.regex.Pattern;
|
||||
|
||||
import org.omegazero.common.config.ConfigArray;
|
||||
import org.omegazero.common.config.ConfigObject;
|
||||
import org.omegazero.common.config.ConfigurationOption;
|
||||
import org.omegazero.common.eventbus.EventBusSubscriber;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent;
|
||||
import org.omegazero.common.eventbus.SubscribeEvent.Priority;
|
||||
import org.omegazero.common.logging.Logger;
|
||||
import org.omegazero.common.logging.LoggerUtil;
|
||||
import org.omegazero.common.plugins.ExtendedPluginConfiguration;
|
||||
import org.omegazero.http.util.HTTPStatus;
|
||||
import org.omegazero.net.socket.SocketConnection;
|
||||
import org.omegazero.proxy.http.ProxyHTTPRequest;
|
||||
@ -37,29 +39,30 @@ public class XForwardedForPlugin {
|
||||
private static final String HEADER_XFP = "x-forwarded-proto";
|
||||
|
||||
|
||||
private String[] allowedClients;
|
||||
@ConfigurationOption
|
||||
private java.util.List<String> allowedClients;
|
||||
@ConfigurationOption
|
||||
private boolean enforceAllowedClients = false;
|
||||
@ConfigurationOption
|
||||
private boolean enforceExpectedParts = false;
|
||||
@ConfigurationOption
|
||||
private boolean requireHeader = false;
|
||||
@ConfigurationOption
|
||||
private boolean includePortNumber = false;
|
||||
@ConfigurationOption
|
||||
private boolean enableDownstream = true;
|
||||
@ConfigurationOption
|
||||
private boolean enableUpstream = true;
|
||||
@ConfigurationOption
|
||||
private boolean forwardHeader = true;
|
||||
@ConfigurationOption
|
||||
private boolean enableForwardProto = true;
|
||||
|
||||
private Object[] expectedParts;
|
||||
private boolean enforceAllowedClients;
|
||||
private boolean enforceExpectedParts;
|
||||
private boolean requireHeader;
|
||||
private boolean includePortNumber;
|
||||
private boolean enableDownstream;
|
||||
private boolean enableUpstream;
|
||||
private boolean forwardHeader;
|
||||
private boolean enableForwardProto;
|
||||
|
||||
|
||||
@ExtendedPluginConfiguration
|
||||
public synchronized void configurationReload(ConfigObject config) {
|
||||
ConfigArray acArr = config.optArray("allowedClients");
|
||||
if(acArr != null){
|
||||
this.allowedClients = new String[acArr.size()];
|
||||
int i = 0;
|
||||
for(Object o : acArr){
|
||||
if(!(o instanceof String))
|
||||
throw new IllegalArgumentException("Values 'allowedClients' must be strings");
|
||||
this.allowedClients[i++] = (String) o;
|
||||
}
|
||||
}
|
||||
ConfigArray epArr = config.optArray("expectedParts");
|
||||
if(epArr != null){
|
||||
this.expectedParts = new Object[epArr.size()];
|
||||
@ -84,14 +87,6 @@ public class XForwardedForPlugin {
|
||||
}
|
||||
}else
|
||||
this.expectedParts = null;
|
||||
this.enforceAllowedClients = config.optBoolean("enforceAllowedClients", false);
|
||||
this.enforceExpectedParts = config.optBoolean("enforceExpectedParts", false);
|
||||
this.requireHeader = config.optBoolean("requireHeader", false);
|
||||
this.includePortNumber = config.optBoolean("includePortNumber", false);
|
||||
this.enableDownstream = config.optBoolean("enableDownstream", true);
|
||||
this.enableUpstream = config.optBoolean("enableUpstream", true);
|
||||
this.forwardHeader = config.optBoolean("forwardHeader", true);
|
||||
this.enableForwardProto = config.optBoolean("enableForwardProto", true);
|
||||
}
|
||||
|
||||
|
||||
@ -122,8 +117,9 @@ public class XForwardedForPlugin {
|
||||
|
||||
boolean allowedClient = false;
|
||||
if(this.allowedClients != null){
|
||||
String clientaddr = ((InetSocketAddress) downstreamConnection.getRemoteAddress()).getAddress().getHostAddress();
|
||||
for(String s : this.allowedClients){
|
||||
if(s.equals(((InetSocketAddress) downstreamConnection.getRemoteAddress()).getAddress().getHostAddress())){
|
||||
if(s.equals(clientaddr)){
|
||||
allowedClient = true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user