Class RouterIpResolverInterceptor

java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.gatekeeper.RouterIpResolverInterceptor
All Implemented Interfaces:
Interceptor

public class RouterIpResolverInterceptor extends AbstractInterceptor
Checks, whether the exchange's remoteIp is one of the routers. If yes, sends a POST to https://$router:$port/ with a body of {"port":$remotePort, "ip":$remoteIp}, expecting an HTTP 200 application/json {"ip":$realIp} in return. If successful, replaces the exchange's remoteIp with the retrieved IP address.

This interceptor is helpful in scenarios with multiple redundant routers for inbound HTTP requests.