I am planning to build a small crawler in C++ for my projects. I chose the Boost.Asio library to achieve networking functionality. But then, I came across Boost.Beast library and I am confused as of which library to use. I have 2 doubts:
Question 1:
Does Boost.Asio support HTTPS and HTTP/2 connections?
Question 2:
What is the difference between Boost.Asio and Boost.Beast?
I have searched some documents and couldn't find useful information. Also, there are only a handful of articles about Boost libraries.
Thanks.
Q1:
No, it will only do TCP for you.
Q2:
Asio:
Boost.Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach. https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio.html
Beast:
Beast is a C++ header-only library serving as a foundation for writing interoperable networking libraries by providing low-level HTTP/1, WebSocket, and networking protocol vocabulary types and algorithms using the consistent asynchronous model of Boost.Asio. https://www.boost.org/doc/libs/1_67_0/libs/beast/doc/html/index.html
In a nutshell, Asio is lower level, helps you with building asynchronous programs, helps with I/O and on the network side is limited to transport layer mostly. It has some support for SSL.
Beast is higher level and helps you when you need HTTP, Websockets etc. It is interoperable with Asio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With