Project

General

Profile

XMPP server's IP different than this pointed by XMPP server's domain

Łukasz Soszyński
Added about 5 years ago

Hi,

I'm using Jaxmpp XMPP client. So far Jaxmpp has met all my needs :)

Recently I run Tigase server in cluster mode in order to ensure HA (high availability).

Almost all my clients use xmpp.mydomain.org address to communicate with Tigase server.

Then DNS server routs clients to apropriate Tigase node:

client -> DNS (xmpp.mydomain.org) -> Tigase node 1 (priv ip 10.0.0.1)/Tigase node 2 (priv ip 10.0.0.2)

But thera are two additional clients on my application server.

Due to security reasons and some network issues clients on my application server have to connect directly to Tigase server.

I have two clients on my application server. One is dedicated for connecting with first Tigase node and the other to connecting with second Tigase node.

            client 1 -> Tigase node 1 (priv ip 10.0.0.1)
APP Server
            client 2 -> Tigase node 2 (priv ip 10.0.0.2)

On my Tigase server I defined account, which should by used by my application server's XMPP clients, it is 1@xmpp.mydomain.org.

Now I configure Jaxmpp client:

    UserProperties properties = jaxmpp.getProperties();
            properties.setUserProperty(SessionObject.USER_BARE_JID, "1@xmpp.mydomain.org");
            properties.setUserProperty(SessionObject.PASSWORD, "pass");
            properties.setUserProperty(SessionObject.RESOURCE, "node1");

It's work fine, but due to network constraint I can't use this configuration. So i tried following configuration:

UserProperties properties = jaxmpp.getProperties();
            properties.setUserProperty(SessionObject.USER_BARE_JID, "1@10.0.0.1");
            properties.setUserProperty(SessionObject.PASSWORD, "pass");
            properties.setUserProperty(SessionObject.RESOURCE, "node1");

But the above configuration doesn't work. There is no damain "10.0.0.1" configured on Tigase server and user account 1@10.0.0.1.

How can I tell Jaxmpp to connect to the account 1@xmpp.mydomain.org but send all network traffic to 10.0.0.1 host?


Replies (1)

Added by Wojciech Kapcia TigaseTeam about 5 years ago

You can configure either SocketConnector or @BoshConnector@, i.e.:

properties.setUserProperty( SocketConnector.SERVER_HOST, 10.0.0.1);
properties.setUserProperty( SocketConnector.SERVER_PORT, 5222 );

for bosh:

properties.setUserProperty( Jaxmpp.CONNECTOR_TYPE, "bosh" );
properties.setUserProperty( BoshConnector.BOSH_SERVICE_URL_KEY, "http://" + 10.0.0.1 + ":5280" );

    (1-1/1)