Nov 8, 2007 9:45 AM
Need to determine the IP address of the Openfire server
-
Like (0)
I have a plugin that needst to determine the IP address that the Openfire server is listening on. Given a machine can have multiple IP addresses (loopback,
wireless, vpn, physical/logical, etc), I need to know the IP address
that it is really using. I was able to look at
the JiveProperties 'listener.hostname' property (In Openfire3.3.3 ),
but that is not available in v3.4.1. Is there a consistent way to determine this?
ALSO, are there any mock objects for Session or Connection for me to do unit tests?
Just an idea:
You could try to resolve your own IP using your DNS:
String host = XMPPServer.getInstance().getServerInfo().getName();
byte[] ip = InetAddress.getByName(host).getAddress();
The server may be listening on multiple addresses as well.