use of org.wildfly.swarm.config.undertow.server.Host in project wildfly-swarm by wildfly-swarm.
the class TopologyProxiedServiceCustomizer method customize.
public void customize() {
Map<String, String> mappings = this.fraction.proxiedServiceMappings();
if (!mappings.isEmpty()) {
HandlerConfiguration handlerConfig = undertow.subresources().handlerConfiguration();
for (String serviceName : mappings.keySet()) {
ReverseProxy<?> proxy = new ReverseProxy<>(proxyHandlerName(serviceName)).hosts(Collections.emptyList());
handlerConfig.reverseProxy(proxy);
String contextPath = mappings.get(serviceName);
for (Server server : undertow.subresources().servers()) {
Location location = new Location(contextPath).handler(proxyHandlerName(serviceName));
for (Host host : server.subresources().hosts()) {
host.location(location);
}
}
}
}
}
Aggregations