33 std::cout <<
"=== HTTP Facade Example ===" << std::endl;
37 srv_config.
port = 8080;
38 srv_config.
server_id =
"example-http-server";
40 std::cout <<
"\n1. Creating HTTP server..." << std::endl;
41 std::cout <<
" Port: " << srv_config.
port << std::endl;
42 std::cout <<
" Server ID: " << srv_config.
server_id << std::endl;
47 std::cout <<
" Server created successfully" << std::endl;
51 std::cout <<
" Server creation returned null (expected in demo)" << std::endl;
56 cli_config.
client_id =
"example-http-client";
57 cli_config.
timeout = std::chrono::seconds(30);
60 std::cout <<
"\n2. Creating HTTP client..." << std::endl;
61 std::cout <<
" Client ID: " << cli_config.
client_id << std::endl;
62 std::cout <<
" Timeout: " << cli_config.
timeout.count() <<
"ms" << std::endl;
63 std::cout <<
" SSL: " << (cli_config.
use_ssl ?
"enabled" :
"disabled") << std::endl;
68 std::cout <<
" Client created successfully" << std::endl;
72 std::cout <<
" Client creation returned null (expected in demo)" << std::endl;
75 std::cout <<
"\nDone." << std::endl;
auto create_server(const server_config &config) const -> Result< std::shared_ptr< interfaces::i_protocol_server > >
Creates an HTTP server with the specified configuration.
auto create_client(const client_config &config) const -> Result< std::shared_ptr< interfaces::i_protocol_client > >
Creates an HTTP client with the specified configuration.
Simplified facade for creating HTTP clients and servers.
Main namespace for all Network System components.
Configuration for creating an HTTP client.
std::string client_id
Client identifier (auto-generated if not provided)
bool use_ssl
Whether to use HTTPS.
std::chrono::milliseconds timeout
Request timeout.
Configuration for creating an HTTP server.
uint16_t port
Port number to listen on.
std::string server_id
Server identifier (optional, auto-generated if not provided)