Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi all,

I have a problem here. There is an off-the-shelf application (Web) that I have been asked to support and maintain. I've set up the application in a testing environment, and in production. It has a configuration file that contains the url of the web application. I think it uses it to point back to a local web service.

Now, the thing is someone suggested that it would be good to have this url to be "localhost" - that way the configuration file is the same in all environments. Should I have used the actual url test.tinyurl.com and prod.tinyurl.com, we end up having different config file for each environment.

Now, I know ways to get around this if it was my own web applications. I would use some sort of machine.config, environment tokens in registry, etc.. But, unfortunately this is a third party software.

I guess now my real question is - Is it okay to use localhost in production config files? What are the CONS of doing this?

Security risk first comes in my mind. Can anyone elaborate more on using localhost in production config?

Thanks

Regards
Posted

1 solution

The problem with using localhost is when localhost is used in Javascript or anything on the client-side, it will call the viewer's localhost.. when what it really meant to do is call the server..

Come on guys.. Any other reasons not to use localhost in your config files?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900