This is usually true, but not in this case where 127.0.0.1 is working differently - the case which this whole thread is about. In my case iE7 looks elsewhere for 127.0.0.1, but not for localhost.
As I said above:( for example)
http://localhost:1982/Attachment/-1 will work
http://127.0.0.1:1982/Attachment/-1 doesn't work
but you may be correct that localhost isn't guaranteed to work if it is modified.
Thanks
Malcolm