This module must be used as a component. For example:
Component "proxy.domain.example" "client_proxy" target_address = "firstname.lastname@example.org"
All IQ requests against the proxy host (in the above example: proxy.domain.example) are sent to a random resource of the target address (in the above example: email@example.com). The entity behind the target address is called the “implementing client”.
The IQ requests are JAT-ed (JAT: Jabber Address Translation) so that when the implementing client answers the IQ request, it is sent back to the component, which reverts the translation and routes the reply back to the user.
Let us assume that firstname.lastname@example.org sends a request. The proxy.domain.example component has the client_proxy module loaded and proxies to email@example.com. firstname.lastname@example.org has two resources, /a and /b.
user -> component: <iq type='get' id='1234' to='proxy.domain.example' email@example.com/abc'> component -> implementing client: <iq type='get' id='1234' firstname.lastname@example.org/a' from='proxy.domain.example/encoded-from'> implementing client -> component: <iq type='result' id='1234' to='proxy.domain.example/encoded-from' email@example.com/a'> component -> user: <iq type='result' id='1234' firstname.lastname@example.org/abc' from='proxy.domain.example'>
The encoded-from resource used in the exchange between the proxy component and the implementing client is an implementation-defined string which allows the proxy component to revert the JAT.
To use this module, it needs to be loaded on a component:
Component "proxy.yourdomain.example" "client_proxy" target_address = "email@example.com"
It will then send a subscription request to firstname.lastname@example.org which MUST be accepted: this is required so that the component can detect the resources to which IQ requests can be dispatched.