Skip to content

Commit

Permalink
Code style for http_proxy_client.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Jan 24, 2024
1 parent 77e882d commit 5c8c831
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions proxy/include/proxy/http_proxy_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,21 @@ namespace proxy {
namespace beast = boost::beast; // from <boost/beast.hpp>
namespace http = beast::http; // from <boost/beast/http.hpp>

using http_request = http::request<http::string_body>;
using http_response = http::response<http::dynamic_body>;

// Options for the HTTP proxy client
struct http_proxy_client_option {
struct http_proxy_client_option
{
std::string target_host; // Target server host
uint16_t target_port; // Target server port
std::string username; // User authentication - username
std::string password; // User authentication - password
bool ssl{ false }; // Use SSL or not
std::string username; // User authentication - username
std::string password; // User authentication - password
bool ssl{ false }; // Use SSL or not
};

namespace detail {

using http_request = http::request<http::string_body>;
using http_response = http::response<http::dynamic_body>;

template <typename Stream>
net::awaitable<boost::system::error_code>
do_http_proxy_handshake(Stream& socket, http_proxy_client_option opt = {})
Expand Down Expand Up @@ -99,9 +100,8 @@ namespace proxy {
if (ec)
co_return ec;

http::response_parser<
http_response::body_type> p;
boost::beast::flat_buffer buffer{ 1024 };
http::response_parser<http_response::body_type> p;
beast::flat_buffer buffer{ 1024 };

do {
co_await http::async_read_header(
Expand Down

0 comments on commit 5c8c831

Please sign in to comment.