aSmack with Openfire client IP address is not shown on server

Hello Everyone

I have a working Openfire and aSmack integrations, however, I have recently implemented Openfire Cluster thus putting Openfire hosts behind a loadbalancer. This has caused two issues for me:-

  1. The client IP address that Openfire see is the loadbalnacers (192.168…) local IP address. so all clients get the same IP address.

  2. Every client connection only last for 1 or 2 seconds and is disconnected.

I have installed Spark XMPP Client on my PC and connected to Openfire but with Spark everything works as expected connections stay as long as needed, the client IP address is shown properly on Openfires sessions UI. I can’t understand what is wrong. Has anyone had similar issue. Please help