[ejabberd] how to find out user IP address from external component?

Eric Cestari eric at ohmforce.com
Sun Oct 11 20:26:53 MSD 2009


Or you can send an admin command :
<iq type="set" to="domain" id="aaf1a" >
<command xmlns="http://jabber.org/protocol/commands" node="http://jabber.org/protocol/admin#user-stats 
" sessionid="2009-10-11T16:19:52.346756Z" >
<x xmlns="jabber:x:data" type="submit" >
<field type="hidden" var="FORM_TYPE" >
<value>http://jabber.org/protocol/admin</value>
</field>
<field type="jid-single" var="accountjid" >
<value>user at domain</value>
</field>
</x>
</command>
</iq>

Answer :
<iq from="domain" type="result" to="admin at domain" id="aaf1a" >
<command xmlns="http://jabber.org/protocol/commands"  
status="completed" node="http://jabber.org/protocol/admin#user-stats"  
sessionid="2009-10-11T16:19:52.346756Z" >
<x xmlns="jabber:x:data">
<field type="hidden" var="FORM_TYPE" >
<value>http://jabber.org/protocol/admin</value>
</field>
<field type="jid-single" label="Jabber ID" var="accountjid" >
<value>user at domain</value>
</field>
<field type="text-single" label="Roster size" var="rostersize" >
<value>42</value>
</field>
<field type="text-multi" label="IP addresses" var="ipaddresses" >
<value>127.0.0.1:1320</value>
</field>
<field type="text-multi" label="Resources" var="onlineresources" >
<value>res</value>
</field>
</x>
</command>
</iq>


All info is available. Of course the user admin at domain (or fake user  
generated from the component) has to be declared admin in ejabberd.cfg :

{acl, admin, {user, "admin", "domain"}}.

Eric

Le 11 oct. 2009 à 17:26, Anton Belyaev a écrit :

> 2009/10/11 Max Ivanov <ivanov.maxim at gmail.com>:
>> I'm writing external XMPP component, and I couldn't figure out how to
>> get IP address of each client connected. Is it possible without
>> writing module for ejabberd?g
>
> I guess the only way is module. But it shouldnt be hard, about dozen
> lines of code.
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd



More information about the ejabberd mailing list