Gjal 0.0.1 For Mac
I've encountered a really strange Mac problem: Safari is unable to connect to localhost whereas all other applications can connect as normal (Firefox, Chrome, ping, etc.). My /etc/hosts is the standard setup: $ egrep localhost /etc/hosts # localhost is used to configure the loopback interface 127.0.0.1 localhost::1 localhost fe80::1%lo0 localhost 127.0.0.1 testing.localhost Question: Have anyone else encountered this?
What could be the problem? Update #1: I have a server running on localhost:8080. When accessing from Safari I get the error message 'Safari could not connect to the server'. ' works flawlessly in Firefox and Chrome.
Update #2: Same problem with ' - so it does not seem to be related to resolving localhost to 127.0.0.1. I think we need a little more information based on your question. I'm going to guess you have a web server running to accept requests?
I currently don't, and Safari won't connect to 127.0.0.1, because it 'Couldn't find 127.0.0.1' - even though I can ping it just fine. So first, you need to have something running.
Secondly, have you tried connecting to testing.localhost with Safari, just incase the two entries are confusing Safari (this is entirely possible). When you say 'applications can connect as normal' with Chrome and Firefox, what are you seeing? The web page you're expecting to see? A different error? Edit I downloaded and installed MAMP, and I could not reproduce this error. Some forum threads suggest IPv6 resolution is causing this issue.
I would be inclined to turn off IPv6 and remove the entry from the hosts file (temporarily just for testing). Apple Menu System Preferences. Network. Select your Network Connection Advanced. Configure IPv6 Off Apply, restart, and see how it goes.
When using Listen 8080 or Listen ::1:8080 in Apache's /etc/apache2/httpd.conf then sudo lsof -i:8080 shows that httpd is using IPv6 only. Next, requesting 127.0.0.1:8080 in Safari makes lsof show Safari uses IPv4, but still connects fine. Using localhost:8080 makes Safari use IPv6. Likewise Listen 127.0.0.1:8080 only enables IPv4.
But: Listen localhost:8080 makes httpd use BOTH IPv4 and IPv6. Still: Safari handles all, on my Mac. (I wonder if @knorv has issues when using Apache or Python rather than the server (s)he is using. And if changing something like Listen helps.) – Sep 7 '09 at 12:10.
![Gjal 0.0.1 For Mac Gjal 0.0.1 For Mac](https://i1.rgstatic.net/publication/287573459_Bone_Health_in_HIV-Infected_Children_Adolescents_and_Young_Adults_A_Systematic_Review/links/567c14e708ae051f9ae17d0f/largepreview.png)
To ensure it's not an issue with your web server (like @nagul asked: what server are you using?), on my 10.6 Snow Leopard with IPv6 left at automatic, and even with 127.0.0.1 testing.localhost added to my /etc/hosts, the following works fine:. Change the Listen port of the built-in Apache from 80 to 8080: sudo vi /etc/apache2/httpd.conf. Run the built-in Apache by enabling System Preferences, Sharing, Web Sharing. Or restart using: sudo apachectl restart Likewise, for me no problems using:. python -m SimpleHTTPServer 8080 I know you stated you're not using any proxy. Just in case there's any doubt: recent versions of Firefox allow you to choose between Firefox-specific network settings (which was the only option in older versions), and the system settings. Safari always uses the system settings.
Gazal 0.0.1 For Mac
Of course, good proxy settings would ignore local addresses (defaults on my Mac for Bypass proxy settings for these Hosts & Domains:.local,.lan, 169.254/16). Still, one could check if Firefox still works when making it use the system settings just like Safari. (Firefox Preferences, Advanced, tab Network, button Settings.) (Anything in the server logs or Console logs? Which version of Mac OS?).