git,curl,wget redirect to locahost
<p>Git gives me this error:</p>



<pre class="lang-none prettyprint-override"><code>$ git clone How people build software Â· GitHub
Cloning into 'xxxx'... fatal: unable to access 'xxx (Michael Dungan) Â· GitHub': Failed to connect to 127.0.0.1 port 443: Connection refused
</code></pre>

<p><code>curl</code> also gives the error:</p>

<pre class="lang-none prettyprint-override"><code>$ curl http://baidu.com
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
</code></pre>

<p><code>wget</code> also gives the error:</p>

<pre class="lang-none prettyprint-override"><code>$ wget http://baidu.com
Error parsing proxy URL â http://127.0.0.1:8123 â: Scheme missing.
</code></pre>

<p>But <code>ping</code> is okay:</p>

<pre class="lang-none prettyprint-override"><code>ping http://baidu.com
PING http://baidu.com (180.149.132.47): 56 data bytes
64 bytes from 180.149.132.47: icmp_seq=0 ttl=52 time=24.689 ms
64 bytes from 180.149.132.47: icmp_seq=1 ttl=52 time=23.770 ms
64 bytes from 180.149.132.47: icmp_seq=2 ttl=52 time=25.112 ms
</code></pre>

<p>And my browser is okay.</p>

<p>I have restarted my Mac, closed my proxy, VPN, but the it never changes. This problem appears after I write this python code:</p>

<pre class="lang-python prettyprint-override"><code>socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050)
socket.socket = socks.socksocket
socket.create_connection = create_connection
socket.getaddrinfo = getaddrinfo
</code></pre>

<p>i have solved this problem, i hava missed the http_proxy,https_proxy system environment variable in <code>/.bash_profile</code>. remove them, it is okay now.</p>

python sockets