Perform a simple HTTP request using C++ / Boost vi

2019-02-18 07:34发布

问题:

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.

回答1:

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.