Code Monkey home page Code Monkey logo

proxy_server_in_c's Introduction

proxy_server_in_c(multi-threaded)

Overview

This project implements a multi-threaded proxy server using semaphores for concurrency control. It handles multiple client requests, caching using the LRU algorithm, and demonstrates proxy functionalities.

Key Features

  • Threading: Manages multiple client requests.
  • Semaphore: Used instead of condition variables and pthread_join()/pthread_exit(). Semaphores' sem_wait() and sem_post() do not need parameters, making them a better option.
  • Cache: Speeds up processing (LRU algorithm).

Limitations

  • Separate cache entries for URLs with multiple clients.
  • Fixed cache element size.

Future Enhancements

  • Multiprocessing for better performance.
  • Selective website access control.
  • Support for POST requests.

Usage

  1. Clone the repository:

  2. Navigate to the project directory:

  3. Build the project:

    make all
  4. Run the proxy server:

    ./proxy <port no.>
  5. Open in browser:

    http://localhost:<port>/any link u want to test (eg--www.google.com)

Notes

  • Linux only. Disable browser cache.
  • For no-cache version, rename proxy_server_with_cache.c to proxy_server_without_cache.c in the MakeFile.

proxy_server_in_c's People

Contributors

drake-knight avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.