Class RouterIpResolverInterceptor
java.lang.Object
com.predic8.membrane.core.sslinterceptor.RouterIpResolverInterceptor
- All Implemented Interfaces:
SSLInterceptor
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPort()handleRequest(SSLExchange exc) voidvoidsetErrorOutcome(Outcome errorOutcome) voidsetHttpClientConfiguration(HttpClientConfiguration httpClientConfiguration) voidsetPort(int port) voidsetRouterIps(String routerIps) voidsetSslParser(SSLParser sslParser)
-
Constructor Details
-
RouterIpResolverInterceptor
public RouterIpResolverInterceptor()
-
-
Method Details
-
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 interfaceSSLInterceptor- Throws:
Exception
-
handleRequest
- Specified by:
handleRequestin interfaceSSLInterceptor- Throws:
Exception
-