Skip to content

Repository files navigation

Multithreaded Proxy Server with Cache

A C-based multithreaded HTTP proxy server that handles concurrent client requests and caches responses using an LRU-style strategy.

Features

  • 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 GET requests to remote servers
  • Stores responses in an in-memory cache and serves cache hits directly
  • Sends HTTP error responses for invalid/failed requests

Project Structure

  • proxy_server_with_cache.c: Main proxy server implementation with caching
  • proxy_parse.c: HTTP request parsing library implementation
  • proxy_parse.h: HTTP request parsing library interface
  • Makefile: Build rules
  • make.bat: Windows wrapper for mingw32-make

Requirements

  • Windows + MSYS2 UCRT64 toolchain
  • g++, mingw32-make
  • WinSock library (ws2_32) for networking (already linked in Makefile)

Build

From the project directory:

.\make.bat

Run

.\proxy 8080

Use any free port instead of 8080 if needed.

Notes

  • The proxy currently supports GET requests.
  • Cache size and related limits are defined with macros in proxy_server_with_cache.c.
  • If make is not recognized in a new terminal, use make.bat from the project folder.

About

This project demonstrates the implementation of encryption and decryption mechanisms using parallel processing techniques in C++. By leveraging both multiprocessing and multithreading, the project aims to enhance the efficiency and performance of cryptographic operations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages