Archived

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

Getting IP from glacier service

dakotadelnorte
edited January 2019 in Help Center

Hi, we need to get the IP of each client that connect with us, as we use glacier and our process its part of Ice.Application, we haven't found a way to get this. I have searched previously in the forum, the discussions more similar that I have found are following:

But the links that linked inside it are broken and I cant found the requested information linked.

Please, could you help me?

Thank you very much in advance.

note: We use ICE version 3.4

Tagged:

Comments

  • benoit
    benoit Rennes, France

    Hi,

    Did you try using the Glacier2.AddConnectionContext property?

    The remoteAddress/remotePort context should provide the information you need.

    Ice 3.4 is quite old, you should consider upgrading to Ice 3.7 :smile:

    Cheers,
    Benoit.

  • Hi,

    Thank you very much for the reply.

    Once the property "Glacier2.AddConnectionContext" is set into the glacier configuration file then you can get the IP from the "Current -> Connection -> ConnectionInfo" object .

    current.con.getInfo().remoteAddress
    

    Taking advantage of this query that is related, there is some way to obtain the "User-Agent" of the client??

    Thank you very much in advance.

  • benoit
    benoit Rennes, France

    Hi,

    I assume you are using Ice for JavaScript for your client? Ice doesn't transmit this information but your JavaScript client application could provide it using the Ice::Context parameter of the session creation method for example.

    Cheers,
    Benoit.