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;