使用 C++ 执行简单的 HTTP 请求/ 通过代理提升?
我是 Boost 的新手,我唯一通过使用库的代理进行冲浪的经验是使用 .NET(这对于此目的来说非常方便)。我现在尝试通过 HTTP 代理执行简单的 HTTP 请求。
有没有直接使用 boost 的简洁方法?
我的代理使用 NTLM 身份验证。
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.
Is there a tidy way to do it using boost directly?
My proxy use a NTLM authentification.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,Boost 既不提供 HTTP 客户端,也不提供与代理交互的方式。您必须自己实现这些功能。
需要明确的是,是的,可以使用 Boost.Asio 实现 HTTP 客户端。但是实现一个可以通过代理可靠地通信的客户端要复杂得多,而且 Asio 不提供任何超出低级套接字本身的支持。它当然不包括执行 NTLM 身份验证的框架,这可能很难正确执行。
更复杂的库如 cURL 提供了这种支持。
No, Boost provides neither an HTTP client nor a way to interface with proxies. You would necessarily have to implement those features yourself.
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.
More complex libraries like cURL provide that support.