Hello,
is there any way how to obtain localAddr from incoming request? I mean if I have multiple virtual addresses/interfaces on host and I need to distinguish on which address was the request accepted.
Only way which I found now is little hack with netty's HttpServerRequest.
if ((((AbstractServerHttpRequest) exchange.getRequest()).getNativeRequest()) instanceof HttpServerRequest) {
final InetSocketAddress localAddress = ((HttpServerRequest) (((AbstractServerHttpRequest) exchange.getRequest()).getNativeRequest())).hostAddress();
logger.debug("!!! Hostname {}, HostString {}, Address {}",
localAddress.getHostName(),
localAddress.getHostString(),
localAddress.getAddress()
);
}
Is there any general approach?
Thanks
Hello,
is there any way how to obtain localAddr from incoming request? I mean if I have multiple virtual addresses/interfaces on host and I need to distinguish on which address was the request accepted.
Only way which I found now is little hack with netty's HttpServerRequest.
Is there any general approach?
Thanks