Class RouterIpResolverInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.gatekeeper.RouterIpResolverInterceptor
- All Implemented Interfaces:
Interceptor
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPort()handleRequest(Exchange exc) voidvoidsetErrorOutcome(Outcome errorOutcome) voidsetHttpClientConfiguration(HttpClientConfiguration httpClientConfiguration) voidsetPort(int port) voidsetRouterIps(String routerIps) voidsetSslParser(SSLParser sslParser) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, handleResponse, init, setDisplayName, setFlow
-
Constructor Details
-
RouterIpResolverInterceptor
public RouterIpResolverInterceptor()
-
-
Method Details
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-
getRouterIps
-
setRouterIps
-
getHttpClientConfiguration
-
getPort
public int getPort() -
setPort
public void setPort(int port) - Default
- If not set (=0), the default port of the connection protocol (https) is used.
-
getErrorOutcome
-
setErrorOutcome
- Default
- ABORT
-
setHttpClientConfiguration
-
getSslParser
-
setSslParser
-
init
- Specified by:
initin interfaceInterceptor- Overrides:
initin classAbstractInterceptor- Throws:
Exception
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-