Getting IP from glacier service

dakotadelnortedakotadelnorte Roberto Orden ErenaOrganization: ZennioProject: Home automation remoteMember
edited January 10 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:

Answers

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff

    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.

  • josedavidjosedavid ToledoJose DavidOrganization: ZennioProject: Home automation remoteMember

    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.

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff

    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.

Sign In or Register to comment.