Project

General

Profile

Can't get sender's IP address with BOSH

Igor Khomenko
Added over 4 years ago

I'm experimenting with an ability to get sender's IP address

For example, I have custom Tigase plugin.

When I use the desktop/mobile client and log packet.getFrom() - I get

c2s@ip-10-xxx-xxx-xx.internal/10.xx.xxx.xx_5222_xx.xxx.xx.xx_64813 where user's IP address is in bold

With BOSH I receive next:

bosh@ip-xx-xxx-xxx-xx.internal/ab040b3f-4bea-476f-8b16-fcf16962bd22 with no IP

Is it possible to extract the sender's IP when use BOSH?


Replies (3)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

There is no information about Bosh IP address in a plugin. The Bosh session is not identified by the TCP/IP connection because, each Bosh request can be made on a different TCP/IP connection. The client port number is different and IP address can be different too, although in most cases it is the same.

Added by Igor Khomenko over 4 years ago

Thanks

what do you recommend? Switch to WebSockets?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

Web sockets are always recommended over Bosh for performance reasons and significantly lower sources usage plus much better connection reliability. Therefore, if it is possible use Websockets. However, as far as I know, Websockets are not always an option.

    (1-3/3)