Skip to content

zubedev/inspector

Repository files navigation

██╗███╗   ██╗███████╗██████╗ ███████╗ ██████╗████████╗ ██████╗ ██████╗
██║████╗  ██║██╔════╝██╔══██╗██╔════╝██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗
██║██╔██╗ ██║███████╗██████╔╝█████╗  ██║        ██║   ██║   ██║██████╔╝
██║██║╚██╗██║╚════██║██╔═══╝ ██╔══╝  ██║        ██║   ██║   ██║██╔══██╗
██║██║ ╚████║███████║██║     ███████╗╚██████╗   ██║   ╚██████╔╝██║  ██║
╚═╝╚═╝  ╚═══╝╚══════╝╚═╝     ╚══════╝ ╚═════╝   ╚═╝    ╚═════╝ ╚═╝  ╚═╝
>------------------------------------- API for Inspecting HTTP Requests

FastAPI python mypy black Ruff pre-commit license CI

Features

  • See your own IP address
  • IP address to Country
  • Inspect HTTP headers

Usage

# Copy the example environment file to .env
# For development you should set DEBUG=True
cp .env.example .env

# Build the docker image and run the container
docker-compose up --build --detach

API is now available at http://localhost:8888 (by default) - host and port can be changed in .env.

Endpoints

  • root: / - See application info
  • headers: /headers - See HTTP request headers
  • country: /country - See country of IP address

Schema documentation is available through Swagger and ReDoc:

Development

# Poetry is required for installing and managing dependencies
# https://python-poetry.org/docs/#installation
poetry install

# Run the application
poetry run python main.py

# Install pre-commit hooks
poetry run pre-commit install

# Formatting (inplace formats code)
poetry run black .

# Linting (and to fix automatically)
poetry run ruff .
poetry run ruff --fix .

# Type checking
poetry run mypy .

Configuration details can be found in pyproject.toml.

Support

Paypal