Archived

This forum has been archived. Please start a new discussion on GitHub.

How to get client's ip address when I use Glacier?

Hi,
Could u show me how to get client's ip address when I use Glacier,I used Ice::Current to get the connection's peer address info,like this
c.con->toString();
c is a Current&,but it show
local address = 127.0.0.1:2384
remote address = 127.0.0.1:3161
I know it's right,because I use Glacier,but I want to get real client's ip address,how to get it?
Thanks!

Regards

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Where do you want to get this address? It's not possible to access the information of the connection between Glacier2 and the client from a backend server (such as the permission verifier or session manager for example).

    With Ice 3.1, the Ice context used by the client to create the session (with Router::createSession) will be passed to the permission verifier and the session manager create method so you'll be able to set the IP address for example in a context in the client and access it from the implementation of the permission verifier or session manager create method. See also the discussion [thread=2072]here[/thread].

    Cheers,
    Benoit.
  • Thanks

    Thanks benoit,I want to get real client's ip address from all backend icebox server ,as u said,there will be a solution on this issue,it's great!

    Thanks again!


    Regards