public ReverseProxyMapDSL to(String... upstreams) { return to(U.list(upstreams)); }
public ReverseProxyMapDSL map(String uriPrefix) { return new ReverseProxyMapDSL(uriPrefix); }
public ReverseProxy add() { return addTo(On.setup()); }
private void applyProxyEntry(String uri, ProxyConfig config) { ReverseProxyMapDSL proxy = Reverse.proxy(uri); if (config.upstreams != null) proxy.to(config.upstreams); if (config.cacheTTL != null) proxy.cacheTTL(config.cacheTTL); if (config.cacheCapacity != null) proxy.cacheCapacity(config.cacheCapacity); if (config.roles != null) { proxy.roles(config.roles); App.boot().auth(); } proxy.add(); }
public ReverseProxy addTo(Setup setup) { Log.info("!Reverse proxy mapping", "!uriPrefix", uriPrefix, "!upstreams", upstreams); ReverseProxy proxy = createReverseProxy(); U.must(uriPrefix.startsWith("/"), "The URI prefix must start with '/'"); String path = uriPrefix.equals("/") ? "/*" : uriPrefix + "/*"; OnRoute route = setup.any(path); if (roles != null) route.roles(roles); if (cacheTTL != null) route.cacheTTL(cacheTTL); if (cacheCapacity != null) route.cacheCapacity(cacheCapacity); route.serve(proxy); return proxy; }
public ReverseProxy addTo(Setup setup) { Log.info("!Reverse proxy mapping", "!uriPrefix", uriPrefix, "!upstreams", upstreams); ReverseProxy proxy = createReverseProxy(); U.must(uriPrefix.startsWith("/"), "The URI prefix must start with '/'"); String path = uriPrefix.equals("/") ? "/*" : uriPrefix + "/*"; OnRoute route = setup.any(path); if (roles != null) route.roles(roles); if (cacheTTL != null) route.cacheTTL(cacheTTL); if (cacheCapacity != null) route.cacheCapacity(cacheCapacity); route.serve(proxy); return proxy; }
public ReverseProxyMapDSL to(String... upstreams) { return to(U.list(upstreams)); }
public ReverseProxyMapDSL map(String uriPrefix) { return new ReverseProxyMapDSL(uriPrefix); }
public ReverseProxy add() { return addTo(On.setup()); }