Search a compatible proxy/binding


I have the following topology:

wan <----> server 1 <----> server 2

On server 2 runs a openfire server and I need on server 1 a software, which works as proxy or http binding or something like that, connecting to server 2.

The problem is server 2 can only reached over a http proxy.

Is there any possibility to get it running or to write anything for that?