A C-based multithreaded HTTP proxy server that handles concurrent client requests and caches responses using an LRU-style strategy.
- Handles multiple client connections using threads (
pthread) - Uses a semaphore to limit active concurrent requests
- Parses HTTP requests with
proxy_parse.c/proxy_parse.h - Forwards
GETrequests to remote servers - Stores responses in an in-memory cache and serves cache hits directly
- Sends HTTP error responses for invalid/failed requests
proxy_server_with_cache.c: Main proxy server implementation with cachingproxy_parse.c: HTTP request parsing library implementationproxy_parse.h: HTTP request parsing library interfaceMakefile: Build rulesmake.bat: Windows wrapper formingw32-make
- Windows + MSYS2 UCRT64 toolchain
g++,mingw32-make- WinSock library (
ws2_32) for networking (already linked inMakefile)
From the project directory:
.\make.bat.\proxy 8080Use any free port instead of 8080 if needed.
- The proxy currently supports
GETrequests. - Cache size and related limits are defined with macros in
proxy_server_with_cache.c. - If
makeis not recognized in a new terminal, usemake.batfrom the project folder.