我正在使用google-cloud-cpp (C++ API for Google Cloud Platform functions)来创建/读取/写入存储桶。当我在组织的防火墙内工作时,我必须使用代理才能连接到google云。我看到我们可以使用gcloud命令行配置一个代理: gcloud config set proxy/type http gcloud config set proxy/address x.x gcloud config set proxy/port
当我使用google-cloud-cpp时,我可以做类似的事情吗?
发布于 2019-10-24 05:30:42
如果我们查看在GitHub上找到的google-cloud-cpp库的源代码,我们会发现它是基于libcurl的。
在@Travis Webb的评论之后,我们查看libcurl的文档并找到:
https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html
本文档介绍了可用于为使用libcurl的程序设置代理服务器的API。但是,如果我们深入阅读,我们会发现一个关于环境变量的部分,其中声明可以设置http_proxy和https_proxy。
https://stackoverflow.com/questions/58530120
复制相似问题