Server IP address

Server IP address

Hello all,

After a user login, is the server IP address (or server host name) acessible to a application as is the userID and userName?
If no, is there a way to get it?

Thanks in advance
Hi, you won't have that info just as in userId or userName.
In fact that info is bounded to the request. The way to extract info (any other info also) that goes on the request is thru HttpRequestHandler extension, and to get the ip, you have GetIP action (Gets the IP host address of the remote client (IP of the user machine performing the HTTP request).)

Hope this helps.
Luis Lopes
I sometimes encounter problems with my IP address like i've been blocked for no reason.
I think that the OP intends to know how to get the server IP, and not the client's. If so, you can obtain it using the collection item Request.ServerVariables["LOCAL_ADDR"]; (you can easily add a function that returns it to HttpRequestHandler extension) and you should get the server ip.

Best regards,
 Tiago Martins
I don't know if this applies to whatever you're trying to acomplish, but I have sucessfully used "localhost" before to avoid the need of getting the server address, while keeping the application dynamic, ready for new environments.

Just a quick side note everyone: don't forget that on a multi-node Agile Platform installation, each request by the same user may be answered by a different node depending on how you have the load balancer set up.

Just a thought if you ever implement something that decides to store this IP somewhere... :)

@Miguel: That was actually the reason that made me use the ServerVariable collection in the first place... to know exactly what node was performing my requests during runtime...