GithubHelp home page GithubHelp logo

mumukshtayal / https-smart-proxy-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.4 MB

C implementation for Smart Proxy Server for HTTP and HTTPS based URL filtering.

C 100.00%
http-proxy https-proxy lru-cache multithreading proxy-server

https-smart-proxy-server's Introduction

URL_Filter_Project

Proxy Server in C

This project is a simple proxy server used for URL filtering and implemented in C. It supports request caching and URL blocking functionality. There are 2 separate files, one for HTTP proxy and other for HTTPS proxy. Following are the steps and guide based on HTTP Proxy, but similar steps shall be followed for HTTPS proxy file as well.

How to Run

  1. Compile the proxy server code using gcc. For example:
gcc -o HTTP_Proxy HTTP_Proxy.c
  1. Run the compiled binary. You can specify the port number for the proxy server to listen on using the -p option. For example, to have the proxy server listen on port 8080:
./proxy -p 8080

If you don't specify a port number, the program will prompt you to enter one when it starts.

Blocklist

The proxy server supports blocking specific URLs. The list of blocked URLs is stored in a file named Blocklist.txt in the same directory as the proxy server program.

You can add URLs to the blocklist by entering the a command at the proxy server's command prompt, followed by the URL to block. For example:

Enter a command (a - add, r - remove, l - list, q - quit): r
Enter the URL to remove: www.example.com

You can view the current blocklist by entering the l command at the proxy server's command prompt. For example:

Enter a command (a - add, r - remove, l - list, q - quit): l

The blocklist is saved to the Blocklist.txt file whenever a URL is added or removed. The proxy server also loads the blocklist from this file when it starts.

Cache

The proxy server caches responses from the target servers. The cache size is limited to 10 entries. When the cache is full, the least recently used entry is replaced.

Quitting

You can quit the proxy server by entering the q command at the proxy server's command prompt. For example:

Enter a command (a - add, r - remove, l - list, q - quit): q

Future Ideas

Plans to implement a more robust technique to address queries parallely on HTTPS. Current technique uses multithreading to serve the connections which can be a bottleneck while scaling. Primarily the goal is to minimise the lag due to blocking I/O operations by implementing asynchronous I/O or Event Driven Architecture.

https-smart-proxy-server's People

Contributors

mumukshtayal 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.