Current progress on the proxy, currently getting stuck on sending back to browser

This commit is contained in:
TriantaTV 2023-10-02 16:48:15 -05:00
parent 0ea28af44d
commit f8f03bb5ee

View File

@ -18,8 +18,6 @@ int main(void)
Client browser; Client browser;
Client webserver; Client webserver;
proxy.Open();
// Main loop to listen, accept, and then spin-off a thread to handle the GET // Main loop to listen, accept, and then spin-off a thread to handle the GET
while (1) while (1)
{ {
@ -33,8 +31,11 @@ int main(void)
std::cerr << "ERROR - Unable to connect to webserver" << std::endl; std::cerr << "ERROR - Unable to connect to webserver" << std::endl;
continue; continue;
} }
auto newThreadRequest = std::async(std::launch::async, HandleClient, browser.socketFD, webserver.socketFD); auto newThreadRequest1 = std::async(std::launch::async, PipeSockets, browser.socketFD, webserver.socketFD);
pending_futures.push_back(std::move(newThreadRequest)); 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(); proxy.Close();
return 0; return 0;