Search code examples
curlhttp-proxy

Difference between --noproxy and --no-proxy CURL?


I can't find any documentation on it, or maybe it's just a weird behavior...

I have a curl command like this (simplified) that it is executed on a server behind a proxy, and I don't want to use the proxy for a specific route :

curl toto:1337/api -> doesn't work because of the proxy

curl toto:1337/api --no-proxy toto:1337/api -> works fine...

curl toto:1337/api --noproxy toto:1337/api -> doesn't work (hits the proxy)

curl toto:1337/api --noproxy toto -> works fine...

Anyone can explain the difference or link to some docs for --no-proxy ?

Thanks


Solution

  • I opened an issue on github : https://github.com/curl/curl/issues/3906

    It has been corrected so that it generates an error on non-boolean options (--no in --no-proxy was in fact --proxy with a boolean false).

    Yes, because --no-proxy will act exactly like --proxy. The --no- prefix only has a meaning for boolean command line options.