使用 C++ 执行简单的 HTTP 请求/ 通过代理提升?

发布于 2024-08-05 16:47:42 字数 145 浏览 3 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

客…行舟 2024-08-12 16:47:42

不,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文