Coder Social home page Coder Social logo

https_proxy_server's Introduction

About

This application serves as a proxy web server for http/s methods such as GET, POST, HEAD and CONNECT. Furthermore Chunk Parsing Transfer Encoding is also implemented. To serve the request new threads are spawned. I did not find C equivalent of 'select' for Haskell suitable to the project. So this uses polling mechanism to check the socket that are ready to recieve or send data.

One can filter out the sites that they don't want the client to access. For now, one needs to specify the whole host name in the filter list while passing as commandline argument since the code does a string comparision rather than prefix or suffix matching. Also one can find statistics related to the number of requests resulted in success, failure and filter.

Implementation Details

This describes the modules used in this project.

Usage

    $: bash startServer.sh [filter list seperated by space]

Example:

    $: bash startServer.sh www.facebook.com:443 www.google.com:443

Closing the program:

    $: kill SIGUSR2 [pid]           # SIGINT is disabled.

Checking the statistics:

    $: kill SIGUSR1 [pid]

One can check the memory this application is using by plotting the graph thorugh the following command.
NOTE: It requires certain python libraries such as psrecord.

    $: bash checkStats.sh [plot_number]

Issues

  • Graceful exit : It is not always possible to gracefully exit the program as some thread might be reading from a socket.
  • Starvation : If too many clients are connected, this would create a lot of threads leading to two major problems. First, some threads might get scheduled much later. Second, memory consumption of the program will rise.

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.