How to make curl ignore proxies?

How to make curl ignore proxies? Setting $ NO_PROXY doesn't seem to work for me.

+55
curl
Apr 29 '09 at 3:56
source share
10 answers

I suppose that curl reads the proxy address from the http_proxy environment http_proxy and that the variable should retain its value. Then in a shell like bash, export http_proxy=''; before the command (or in a shell script) temporarily changes its value.

(See the twist guide for all the variables he is looking at under the heading ENVIRONMENT .)

+25
Apr 29 '09 at 4:54
source share

If your curl has at least version 7.19.4 , you can simply use the --noproxy flag.

 curl --noproxy "*" http://www.stackoverflow.com 

From manual .

+95
May 21 '12 at 17:35
source share

I ran into the same problem because I set the http_proxy and https_proxy environment variables. But sometimes I connect to another network and have to temporarily disable the proxy server. The easiest way to do this (without changing environment variables):

 curl --noproxy '*' stackoverflow.com 

From the manual: "The only wildcard is the only * character that matches all hosts and effectively disables the proxy server."

The * character is quoted so that the shell is not erroneously expanded.

+50
Jul 17 '13 at 21:45
source share

A long snapshot, but try setting the proxy to "" (empty line), which should override any proxy server settings according to the man page.

+5
Apr 29 '09 at 4:17
source share

I have http_proxy and https_proxy . I don't want to --noproxy '*' and --noproxy '*' those environments , but --noproxy '*' works fine for me.

 curl --noproxy '*' -XGET 172.17.0.2:9200 { "status" : 200, "name" : "Medusa", "cluster_name" : "elasticsearch", "version" : { "number" : "1.5.0", "build_hash" : "544816042d40151d3ce4ba4f95399d7860dc2e92", "build_timestamp" : "2015-03-23T14:30:58Z", "build_snapshot" : false, "lucene_version" : "4.10.4" }, "tagline" : "You Know, for Search" } 
+5
Sep 28 '16 at 20:58
source share

First I listed the current proxy setting using

 env | sort | less 

(should be something like http_proxy=http://wpad.local.machine.location:port number )

Then I tried to install

 export http_proxy=";" 

who gave this error message:

 curl: (5) Couldn't resolve proxy ';' 

I tried

 export http_proxy="" && curl http://servername:portnumber/destinationpath/ -d 55 

and it worked!

PS! Do not forget to set the initial settings for http-proxy with

 export http_proxy=http://wpad.local.machine.location:port number 
+4
Mar 13 2018-12-12T00:
source share

Add your proxy settings to .curlrc

 proxy = 1.2.3.4 noproxy = .dev,localhost,127.0.0.1 

This will make all the dev domains and the local computer request to ignore the proxy.

+3
Oct 20 '17 at 12:17
source share

You should use the $no_proxy env variable (lower case). Please refer to https://wiki.archlinux.org/index.php/proxy_settings for examples.

Also, there was an error in curl a long time ago http://sourceforge.net/p/curl/bugs/185/ , maybe you are using an ancient version of curl that includes this error.

+2
May 12 '14 at 16:05
source share

My curl did not ignore the proxy on Ubuntu 12.04 until I set the environment variable "no_proxy" (lowercase). The --noproxy option is not available.

0
Aug 6 '13 at 16:30
source share

Lame answer, but: Remember to make sure that the proxy is not installed in the ~/.curlrc (...) file.

0
Aug 14 '17 at 12:02 on
source share



All Articles