20 #ifndef RIPPLE_NET_HTTPSTREAM_H_INCLUDED
21 #define RIPPLE_NET_HTTPSTREAM_H_INCLUDED
23 #include <ripple/core/Config.h>
24 #include <ripple/net/HTTPClientSSLContext.h>
26 #include <boost/asio/spawn.hpp>
27 #include <boost/asio/strand.hpp>
28 #include <boost/beast/core.hpp>
29 #include <boost/beast/http.hpp>
38 using request = boost::beast::http::request<boost::beast::http::empty_body>;
39 using parser = boost::beast::http::basic_parser<false>;
43 [[nodiscard]]
virtual boost::asio::ip::tcp::socket&
46 [[nodiscard]]
virtual bool
51 boost::asio::yield_context& yield) = 0;
56 boost::asio::yield_context& yield,
57 boost::system::error_code& ec) = 0;
61 boost::beast::flat_buffer& buf,
63 boost::asio::yield_context& yield,
64 boost::system::error_code& ec) = 0;
68 boost::beast::flat_buffer& buf,
70 boost::asio::yield_context& yield,
71 boost::system::error_code& ec) = 0;
79 boost::asio::io_service::strand& strand,
84 boost::asio::ip::tcp::socket&
92 boost::asio::yield_context& yield)
override;
97 boost::asio::yield_context& yield,
98 boost::system::error_code& ec)
override;
102 boost::beast::flat_buffer& buf,
104 boost::asio::yield_context& yield,
105 boost::system::error_code& ec)
override;
109 boost::beast::flat_buffer& buf,
111 boost::asio::yield_context& yield,
112 boost::system::error_code& ec)
override;
124 RawStream(boost::asio::io_service::strand& strand);
128 boost::asio::ip::tcp::socket&
136 boost::asio::yield_context& yield)
override;
141 boost::asio::yield_context& yield,
142 boost::system::error_code& ec)
override;
146 boost::beast::flat_buffer& buf,
148 boost::asio::yield_context& yield,
149 boost::system::error_code& ec)
override;
153 boost::beast::flat_buffer& buf,
155 boost::asio::yield_context& yield,
156 boost::system::error_code& ec)
override;
165 #endif // RIPPLE_NET_HTTPSTREAM_H