powered by Jive Software

Smack get current logged-in user ip

We are working on a VoIP client we will try to implement jingle but the first step is to get the client’s IP

Is there a way to retrieve the IP the server is currently using to send data to the client ?

to be clear I do not want others IP but my IP so i can start negotiation for the session.

would file transfer API be any of help to achieve this goal ?

If I understand you correctly, you want to get your clients IP on the client itself.
In that case you probably need to consider what others wrote here.

this suggested to use external urls,
my question is how smack can achieve this in file transfer API ,
if I understand that file transfer is p2p streming so how clients resolved their IPs ?

Smack does some P2P stuff in the Socks5Bytestream code. You can take a look at the Socks5BytestreamManager, but afaict Smack creates a Socks5 proxy to send/receive data.

1 Like

thank you this is helpful , I will try to implemented as smack does.

but i have a question about external url that return myIP ,
if 2 clients resolved their ip’s and then created sockets using a available ports is that enough to achieve a p2p or there is a “catch” ?
just asking if the logic is valid .

I’m not a network expert, but I guess that problem is often resolved by using external proxies (eg. socks5).

1 Like