Rip's Domain

ColdFusion 9: CGI.HTTP_ADDR

Posted in ColdFusion by rip747 on January 21, 2008

The CGI scope that CF returns for each request is extremely useful. Imagine not have this scope and having to use Java or some other trickery to get the information you need, you would probably end up going nuts.

There is one piece of information missing however that I only now I realized wasn’t there. Currently this is no variable within the scope that returns the ip address of the server.  The closest variable that the CGI scope has is the SERVER_NAME variable. Supposedly the variable will return the ip address of the server if the server’s name is not resolved. However you can’t tell it to not resolve it in anyway and always return you the ip address, hence it’s not reliable. The only ways currently to get the server’s ip address are to just know it or use the GetHostAddress() UDF that Ben Forta wrote.

With all that blabbing I just did, what I’m trying to say is that the next very of ColdFusion should have some way of getting this information easily.  My suggestion would be to add a HTTP_ADDR variable to the CGI scope that will always return the server’s ip address.

Tagged with:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: