gpt4 book ai didi

c - http_proxy 是否会在 Linux 中自动为所有应用程序工作?

转载 作者:行者123 更新时间:2023-11-30 16:07:09 27 4
gpt4 key购买 nike

如果我导出http_proxy,那么curl将自动使用代理。这是因为 curl 查找 http_proxy 并在源代码中内部设置代理,还是它自动工作?似乎许多其他应用程序自动支持 http_proxy,所以我想也许 http_proxy 是由 Linux 处理的??

我正在编写一个需要支持代理(http_proxy ENV)的应用程序,并且想知道我应该在源代码中处理http_proxy。

最佳答案

Is this because curl looks up http_proxy and setup proxy internally in the source code or it just automatically works?

curl 获取curl/lib/url.c中环境变量http_proxy的值并处理它。它不会“自动”工作。

I think maybe http_proxy is handled by Linux?

不,事实并非如此。它由curl 显式处理。

wondering should I handle http_proxy in the source code.

您可以保持与 curl 等其他工具的兼容性,并在应用程序中支持 http_proxy 环境变量。

关于c - http_proxy 是否会在 Linux 中自动为所有应用程序工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59743763/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com