Perform a simple HTTP request using C++ / Boost via a proxy?(通过代理使用 C++/Boost 执行简单的 HTTP 请求?)
问题描述
我是 Boost 的新手,我通过使用库的代理浏览的唯一经验是使用 .NET(这对于这个目的来说非常方便).我现在正在尝试通过 HTTP 代理执行一个简单的 HTTP 请求.
I'm quite a newbie with Boost, and my only experience of surfing though a proxy using a library is using .NET (that is really convenient for that purpose). I'm now trying to perform a simple HTTP request through a HTTP proxy.
有没有直接使用 boost 的简洁方法?
Is there a tidy way to do it using boost directly?
我的代理使用 NTLM 身份验证.
My proxy use a NTLM authentification.
推荐答案
不,Boost 既不提供 HTTP 客户端,也不提供与代理交互的方式.您必须自己实现这些功能.
No, Boost provides neither an HTTP client nor a way to interface with proxies. You would necessarily have to implement those features yourself.
明确地说,是的,可以使用 Boost.Asio 实现 HTTP 客户端.但是实现一个可以通过代理进行可靠通信的客户端要复杂得多,而且除了低级套接字本身之外,Asio 不提供任何支持.它当然不包括执行 NTLM 身份验证的框架,这可能证明很难正确.
To be clear, yes, it is possible to implement an HTTP client using Boost.Asio. But implementing a client that can reliably talk through a proxy is significantly more complex, and Asio does not provide any support for that beyond the low-level socket itself. It certainly does not include the framework for performing NTLM authentication, which may prove difficult to get right.
更复杂的库,如 cURL 提供了这种支持.
More complex libraries like cURL provide that support.
这篇关于通过代理使用 C++/Boost 执行简单的 HTTP 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:通过代理使用 C++/Boost 执行简单的 HTTP 请求?


- 如何对自定义类的向量使用std::find()? 2022-11-07
- STL 中有 dereference_iterator 吗? 2022-01-01
- C++ 协变模板 2021-01-01
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- 从python回调到c++的选项 2022-11-16
- 近似搜索的工作原理 2021-01-01
- Stroustrup 的 Simple_window.h 2022-01-01
- 静态初始化顺序失败 2022-01-01
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01