How do I make curl ignore the proxy?

后端 未结 12 1515
别跟我提以往
别跟我提以往 2021-01-30 03:01

How do I make curl ignore the proxy? Setting $NO_PROXY doesn\'t seem to work for me.

12条回答
  •  心在旅途
    2021-01-30 03:22

    In my case (macos, curl 7.54.0), I have below proxy set with ~/.bash_profile

    $ env |grep -i proxy |cut -d = -f1|sort
    FTP_PROXY
    HTTPS_PROXY
    HTTP_PROXY
    NO_PROXY
    PROXY
    ftp_proxy
    http_proxy
    https_proxy
    no_proxy
    

    With unknown reason, this version of curl can't work with environment variables NO_PRXY and no_proxy properly, then I unset the proxy environment variables one by one, until to both HTTPS_PROXY and https_proxy.

    unset HTTPS_PROXY
    unset https_proxy
    

    it starts working and can connect to internal urls

    So I would recommend to unset all proxy variables if you have in your environment as temporary solution.

    unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
    

提交回复
热议问题