Get IP of XMPP Buddy

Paul Aurich paul at
Fri Apr 24 00:29:57 EDT 2009

And Nikolaus Rath spoke on 04/23/2009 08:04 AM, saying:
> Paul Aurich <paul at> writes:
>> My favorite method is this:
>> OUT: <message type='chat' to='my.friend at'><body>Hey,
>> what's your IP address? Run `ifconfig` (`ipconfig /all` on Windows) to
>> check.</body></message>
> Unfortunately that doesn't work behind a NAT router. And there are many
> users for which the above instructions (let alone finding the desired
> number in the resulting output) pose a significant problem...

If you're looking for the external IP address, exists
(and I'm sure there are plenty of other sites like that).

> So there is really no way to programatically obtain the IP? Maybe as
> part of the XMPP protocol?

If a STUN query is successful, the results of purple_stun_discover() will
contain the public IP *of the local user*, provided a STUN server is set
(which is not the case by default).

> Best,
>    -Nikolaus


More information about the Support mailing list