代码之家  ›  专栏  ›  技术社区  ›  libzz

如何设置http请求节点不使用环境设置代理设置?

  •  1
  • libzz  · 技术社区  · 5 年前

    我正在使用的节点RED安装在一个Ubuntu容器的顶部。
    (我没有创建此容器,也不能修改它。)

    我想用一个简单的httpget请求创建一个流到同一个docker网络上的另一个容器,但是我一直得到一个403禁止的错误。

    [{"id":"332622ed.d87fbe","type":"http request","z":"8431aef4.eba67","name":"","method":"GET","ret":"txt","url":"http://172.16.0.5:8080/path/to/something","tls":"","x":890,"y":700,"wires":[["f49e6445.15d988"]]},{"id":"277f03cb.536f8c","type":"inject","z":"8431aef4.eba67","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":730,"y":700,"wires":[["332622ed.d87fbe"]]},{"id":"f49e6445.15d988","type":"debug","z":"8431aef4.eba67","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1050,"y":700,"wires":[]}]
    


    i、 e.通过:

    docker exec -it ubuntu_nodered bash
    curl –X GET "http://172.16.0.5:8080/path/to/something"
    

    curl –X GET --noproxy "*" "http://172.16.0.5:8080/path/to/something"
    

    唉,我得到了这个命令的正确回应。

    如何使流中的HTTP请求不使用172.16.0.x上请求所处环境中的代理设置?

    0 回复  |  直到 5 年前
        1
  •  1
  •   hardillb    5 年前

    你需要设置 NO_PROXY here .

    question/answer 看起来您无法轻松添加IP地址范围,因此需要添加不希望代理的范围内的所有地址。