Skip to content

Lightweight, high-performance HTTP proxy server with asynchronous Python client for efficient request handling and caching

Notifications You must be signed in to change notification settings

Munashe-Njanji/caching-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple asynchronous proxy built with Python and aiohttp. It sends requests to a specified server and caches and logs the responses.

Features

  • Asynchronous HTTP requests using aiohttp
  • Configurable proxy URL
  • Detailed logging of requests and responses
  • Error handling and timeout management

Requirements

  • Python 3.7+
  • aiohttp

Installation

  1. Clone this repository:
git clone https://github.com/yourusername/proxy-client.git
cd proxy-client
  1. Install the required packages:
pip install aiohttp

Usage

  1. Ensure your proxy server is running and accessible.
python proxy_server.py --port 3002 --origin https://dummyjson.com

or

python proxy_server.py --port 3002 --origin https://example.com
  1. Run the client script:
python proxy_client.py
  1. When prompted, enter the proxy URL (e.g., http://localhost:3002).

  2. The client will send requests to the following endpoints:

  • /products
  • /users
  • /todos
  • /carts
  • /posts
  • /comments
  1. Check the console output for detailed logs of each request and response.

Configuration

You can modify the urls list in the __main__ section of the script to change the endpoints the client requests.

Troubleshooting

If you encounter connection issues:

  1. Verify that your proxy server is running and accessible.
  2. Check for any firewall or antivirus software that might be blocking the connection.
  3. Ensure the proxy server is binding to the correct address (0.0.0.0 or localhost).
  4. Try increasing the timeout values in the aiohttp.ClientTimeout configuration.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Lightweight, high-performance HTTP proxy server with asynchronous Python client for efficient request handling and caching

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages