diff options
author | cflip <cflip@cflip.net> | 2022-07-07 09:50:38 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-07-07 09:50:38 -0600 |
commit | 76e6c3d690caac3faa664b7b8b79cbc7c6a58394 (patch) | |
tree | 8b0ebbc6fe543a1dc0b9d8eba72efd35f8817aa6 /src/main.cpp |
Initial commit
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..60c7b4f --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,25 @@ +#include <iostream> + +#include "ClientConnection.h" +#include "HttpResponse.h" +#include "ServerConnection.h" + +int main(int argc, char** argv) +{ + ServerConnection server(8080); + + std::cout << "cfws v0.1.0]\n"; + + while (true) { + std::cout << "Waiting for connections on port 8080" << std::endl; + ClientConnection client = server.accept_client_connection(); + client.dump_request_data(); + + HttpResponse http_response(ResponseCode::OK); + http_response.add_header("Server: cfws"); + + const char* message = "Welcome to the page."; + client.send(http_response, message); + client.close(); + } +} |