Home Help Center

Get the client's IP from behind Glacier2

Pompei2Pompei2 Member Lucas BeyerOrganization: none (student)Project: Arkana-FTS, an open-source Real Time Strategy game
Hello,

I want my server that is behind the Glacier2 Firewall/Router to know the IP address of the client it interacts with.
I already read the corresponding FAQ and found a quite old forum post about this.

I don't want to have the client always send me this information and trust him that it's correct. That would be burdensome.

Is there any way to get this information from Glacier2?

Thanks in advance.

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Unfortunately, unless you use SSL and createSessionFromSecureConnection, there is no way to do this unless you have the client set its own IP address in the context parameter used for createSession. We'll think about changing this for the next major release.
  • Pompei2Pompei2 Member Lucas BeyerOrganization: none (student)Project: Arkana-FTS, an open-source Real Time Strategy game
    Thank you for the fast answer. Nice to hear you'll integrate this feature.

    After reading the createSessionFromSecureConnection reference, I don't understand how to get the IP with this. If I understand correctly, this method is called from the client to create a session object. I don't see where it lets my server (behind glacier2) see the client's IP? If that works, I would be very happy with it as I wanted to create SSL connections anyway! Please, give me some more pointers :)
  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    Take a look at the "Obtaining SSL Credentials" section here and the "Glacier2.AddSSLContext" property reference here. "SSL.Remote.Host" is the context setting you need to look at to get client ip.
  • Pompei2Pompei2 Member Lucas BeyerOrganization: none (student)Project: Arkana-FTS, an open-source Real Time Strategy game
    Hey, that's exactly what I was looking for, thank both of you a lot!
Sign In or Register to comment.