powered by Jive Software

How to determine the IP address Opnfire is bound to

Hi all,

On a server with multiple IP addresses, how can my plugin determine which IP address Openfire binds to for the admin web console on default port 9090.

thanks,

-dele

Dele,

By default, Openfire will attempt to bind to all network interfaces on the machine. Users can override that by setting the property “network.interface”. You can grab that value (if it exists) with:

String interfaceName = JiveGlobals.getXMLProperty(“network.interface”);

Is that what you’'re looking for?

Regards,

Matt

Hi Matt,

Thanks for the response, but that solution wont help me. I asume network.interface points to a MAC address. See here for the specifics and background the problem I am trying to solve.

In short, I am trying to remove an ugly hack in my red5 plugin that uses “localhost” to relay from 9090 to the Openfile http-bind service port on a server with multiple addresses and DNS SRV records.

I noticed that sparkweb web application uses the same port as http-bind. Very cool!!. I might use that aproach sometime in the future. For now, I am going to try the servlet request.getServerName() method next. It might just do the trick.

-dele

Dele,

The network interface is actually typically an IP (but it’'s not often set). The XMPP server name should almost always be the correct thing, however. Why not use that?

Should we make it easier to add arbitrary stuff that will get served by the HTTP-bind port directly? That could be another workaround? Also, the new http binding spec has specific cross-domain ajax support.

-Matt

Servlets can add themselves dynamically to the http-bind service, just like they can with the admin console.

Thanks,

Alex

Alex,

Thanks for the tip.

Which would you prefer plugin developers to use??.

-dele