My clients speak with my servers over custom protocol. Now I'm adding chat system backed by XMPP server (ejabberd). My server will tunnel user messages to XMPP server by logging in XMPP server on behalf of all its clients.
Since a single server can have multiple clients it would be fine to have a single TCP connection from my server to XMPP server. Is this possible? If yes, how to do this? I'm not familiar with XMPP yet.
Seems like XML stream is opened at the beginning and closed at the end, and closing tag doesn't have any indication which stream to close. So I assume I cannot have multiple XML streams over the same TCP connection. Please correct.
I can try to login multiple times with different usernames and specify "from" anywhere it's allowed. I noticed that on many places "from" attribute is optional and ejabberd can assume it probably based on connection, so I worry if this is possible.