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 请求?


基础教程推荐
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 这个宏可以转换成函数吗? 2022-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01