Mental Jetsam

By Peter Finch

Archive for July, 2008

Browser slow to connect to localhost on Vista

Posted by pcfinch on July 11, 2008

I’m developing a little HTTP server in C++ on vista (don’t ask why). Anyway, I found that my browser was REALLY slow when trying to connect to the localhost server “http://localhost:8282/” but not the local IP address “”. When I say slow, I mean about 1 second per connection. A bit of hunting around and I found the following lines in the \windows\system32\drivers\etc\hosts file.       localhost
::1             localhost

I didn’t recognize the last line or know what it does… so I commented it out (I live life on the edge some time!!). Anyway, things sped up! e.g.       localhost
# ::1             localhost

You’ll have to edit the hosts file as the administrator as it’s protected, but this simple little fixed work for me. If your having a similar problem, I hope this helps you too.

Posted in C++/MFC, Vista | 5 Comments »