{"id":16082057,"url":"https://github.com/codewarnab/multithread-proxy-server-in-c_with_cache","last_synced_at":"2025-04-05T11:43:44.461Z","repository":{"id":245928610,"uuid":"819526247","full_name":"codewarnab/multithread-proxy-server-in-c_with_cache","owner":"codewarnab","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-24T20:10:07.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T22:47:34.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codewarnab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-24T17:23:41.000Z","updated_at":"2024-06-24T20:11:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d507d38-f82d-4a2c-9ba5-77f75274172a","html_url":"https://github.com/codewarnab/multithread-proxy-server-in-c_with_cache","commit_stats":null,"previous_names":["codewarnab/multithread_proxy-server-in-c_with_cache"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewarnab%2Fmultithread-proxy-server-in-c_with_cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewarnab%2Fmultithread-proxy-server-in-c_with_cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewarnab%2Fmultithread-proxy-server-in-c_with_cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewarnab%2Fmultithread-proxy-server-in-c_with_cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewarnab","download_url":"https://codeload.github.com/codewarnab/multithread-proxy-server-in-c_with_cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332524,"owners_count":20921852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T11:25:14.331Z","updated_at":"2025-04-05T11:43:44.441Z","avatar_url":"https://github.com/codewarnab.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Proxy Server with Caching\n\n## Overview\nThis project is a multithreaded proxy server with caching capabilities, implemented in C. The server uses the `libcurl` library to fetch data from remote servers and caches the responses to improve performance for repeated requests. The project includes the following main functionalities:\n- Multithreaded handling of multiple client connections.\n- Caching of responses to reduce the number of remote fetches.\n- Fetching data from remote servers using HTTPS.\n- Managing concurrency using pthreads and semaphores.\n\n## Prerequisites\nEnsure you have the following installed on your system:\n- `gcc`: The GNU Compiler Collection\n- `libcurl`: The cURL library for transferring data with URLs\n\n## Getting Started\nTo get started with this project, clone the repository and navigate to the project directory. The repository includes a `Makefile` to simplify the build process.\n\n### Clone the Repository\n```sh\ngit clone https://github.com/your-username/proxy-server-with-caching.git\ncd proxy-server-with-caching\n```\n## Build the Project \nThe Makefile provided in the repository automates the compilation process. To build the project, simply run\n\n```sh\nmake\n```\nThis will compile the source files and generate the executable proxy_server_with_cache_with_curl.\n\n## Run the Proxy Server\nTo start the proxy server, execute the following command:\n```sh\n./proxy_server_with_cache_with_curl \u003cport_number\u003e\n```\nReplace \u003cport_number\u003e with the port number you want the proxy server to listen on. For example:\n\n```sh\n./proxy_server_with_cache_with_curl 8080\n```\n## Connect to proxy server \n\ngo to `http://localhost:8080/http://example.com` in browser incognito tag\n\nThis will send a request to the proxy server, which will fetch the content from http://example.com, cache the response, and return it to the client.\n\n## Understanding the Code\nThe main components of the project are:\n\n- **proxy_server_with_cache_with_curl.c**: Contains the main server logic, including thread management, client handling, and caching.\n- **proxy_parse.h** and **proxy_parse.c**: Include helper functions for parsing HTTP requests and extracting URLs.\n\n## Beej's Guide\nFor a comprehensive understanding of network programming in C, refer to [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/pdf/bgnet_a4_c_1.pdf). This guide is an excellent resource for learning the fundamentals of socket programming and network communication in C.\n\n## Future Work\nThere are several enhancements that can be made to this project:\n\n- Implement more robust error handling and logging.\n- Add support for HTTP POST and other methods.\n- Improve caching strategies (e.g., adding expiration times for cache entries).\n- Implement a configuration file for customizable settings (e.g., port number, cache size).\n\nFeel free to contribute to the project by forking the repository and submitting pull requests!\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewarnab%2Fmultithread-proxy-server-in-c_with_cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewarnab%2Fmultithread-proxy-server-in-c_with_cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewarnab%2Fmultithread-proxy-server-in-c_with_cache/lists"}