Get IP of XMPP Buddy

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


And Nikolaus Rath spoke on 04/23/2009 08:04 AM, saying:
> Paul Aurich <paul at darkrain42.org> writes:
>> My favorite method is this:
>>
>> OUT: <message type='chat' to='my.friend at darkrain42.org/pidgin'><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, http://whatismyip.com 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
> 

~Paul



More information about the Support mailing list