On Mac OS X I have an issue where calling:
curl -v results in:
* Rebuilt URL to: * Trying 62.253.72.153... * Connected to (127.0.0.1) port 80 (#0) > GET / HTTP/1.1 > Host: > User-Agent: curl/7.43.0 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 504 Gateway Timeout < Gateway Timeout: can't connect to remote host * Closing connection 0 The third line there is weird, because should not be 127.0.0.1, but should be 62.253.72.153. I can't see anything weird in my network configuration. Does anyone know what could be causing this?
73 Answers
I have worked around this problem for 1 day because our gerrit server use port 8080. At last I figured it out. Hope this can help.
step 1.
nc -v -w 2 code.estrongs.com 8080 found 0 associations found 1 connections: 1: flags=82<CONNECTED,PREFERRED> outif lo0 src 127.0.0.1 port 52590 dst 127.0.0.1 port 5001 rank info not available TCP aux info available Connection to code.estrongs.com port 8080 [tcp/http-alt] succeeded! if your output looks like above, then find out what process doing stuff on port 5001
step 2.
nettop -nm tcp looks carefully what process is handing 5001(result found by step1).
In my case is acwebsecagent running backgroud and forwarding all 8080 to localhost. I got rid of it by uninstall cisco anyconnect. Everything goes fine now.
So the issue was that the Mac was in a network where the NAT wasn't configured correctly.
1In my case this was caused by antivirus (kav, in particular) that was passing all HTTP requests through itself as a proxy. After shutting it down the problem went away.