From f8f03bb5eef11e5de6c3fc51bbeb1c83d7f33903 Mon Sep 17 00:00:00 2001 From: TriantaTV Date: Mon, 2 Oct 2023 16:48:15 -0500 Subject: [PATCH] Current progress on the proxy, currently getting stuck on sending back to browser --- src/proxy.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/proxy.cpp b/src/proxy.cpp index 31a0ed8..acc3dae 100644 --- a/src/proxy.cpp +++ b/src/proxy.cpp @@ -18,8 +18,6 @@ int main(void) Client browser; Client webserver; - proxy.Open(); - // Main loop to listen, accept, and then spin-off a thread to handle the GET while (1) { @@ -33,8 +31,11 @@ int main(void) std::cerr << "ERROR - Unable to connect to webserver" << std::endl; continue; } - auto newThreadRequest = std::async(std::launch::async, HandleClient, browser.socketFD, webserver.socketFD); - pending_futures.push_back(std::move(newThreadRequest)); + auto newThreadRequest1 = std::async(std::launch::async, PipeSockets, browser.socketFD, webserver.socketFD); + auto newThreadRequest2 = std::async(std::launch::async, ProxySockets, webserver.socketFD, browser.socketFD); + pending_futures.push_back(std::move(newThreadRequest1)); + pending_futures.push_back(std::move(newThreadRequest2)); + std::cout << "Returned from creating threads, continuing..." << std::endl; } proxy.Close(); return 0;