Skip to content

v3.0.0

Latest

Choose a tag to compare

@rmunate rmunate released this 21 Jan 03:05
· 1 commit to v3 since this release
HTTP Proxy Logo

HTTP Proxy Server

Your secure, flexible and professional gateway for managing HTTP/HTTPS traffic!

πŸ“‹ Overview

HTTP Proxy Server is an advanced solution to manage, audit, and control HTTP/HTTPS traffic, ideal for companies and developers. You can run it as a Windows service or as a Python script.

Main features:

  • πŸ”’ Persistent and isolated sessions for each client
  • ⚑ Full RESTful API: login, proxy, session management, headers and cookies
  • πŸ› οΈ Flexible configuration via .env file or environment variables
  • πŸ“‘ Detailed activity logs
  • 🧩 Interactive documentation (Swagger UI)

πŸš€ How to run the server?

πŸ–₯️ As an executable (Windows)

  1. Place HttpProxyServer.exe in the desired folder and run:
    HttpProxyServer.exe
    The process runs in the background, with no visible console.

🐍 As a Python script (development)

  1. Clone the repository and enter the folder:
    git clone <repo_url>
    cd http-proxy-server
  2. Create a virtual environment and install dependencies:
    python -m venv venv
    venv\Scripts\activate
    pip install -r requirements.txt
  3. Run the server:
    python main.py

βš™οΈ Configuration

Configuration is flexible and follows this priority:

  1. .env file (in the same folder as the executable/script)
  2. Environment variables
  3. Default values

Example .env:

SERVER_HOST=0.0.0.0
SERVER_PORT=8000
LOG_LEVEL=info
ACCESS_LOG=false
RELOAD=false
WORKERS=1
SESSION_TIMEOUT=600
CLEANUP_INTERVAL=300

Equivalent environment variables:

set SERVER_HOST=0.0.0.0
set SERVER_PORT=9000
set LOG_LEVEL=debug
set SESSION_TIMEOUT=1200
set CLEANUP_INTERVAL=600
set ACCESS_LOG=true

🌐 Main endpoints and use cases

Note: After creating a session, you must send the X-Session-ID header in all requests.

Health Check

GET /health-check β€” Checks server and connectivity status.

Create session

POST /subscribe β€” Creates a unique session for the client.
Response:

{
  "status": "OK",
  "session": { "session_id": "..." }
}

Delete session

POST /unsubscribe β€” Deletes the session and clears cookies/headers.

Set custom headers

POST /set-headers β€” Defines HTTP headers for the session.

{
  "Authorization": "Bearer token123",
  "X-Custom-Header": "CustomValue"
}

Get current headers

POST /get-headers β€” Returns the configured headers.

Get current cookies

POST /get-cookies β€” Returns the session's active cookies.

Full session info

POST /get-session-info

HTTP/HTTPS proxy requests

POST /forward β€” Forwards any HTTP/HTTPS request using the active session.

{
  "url": "https://api.company.com/data",
  "method": "GET",
  "headers": { "Accept": "application/json", "X-Session-ID": "abc123" }
}

File download

POST /dowwnload β€” Downloads binary files while maintaining session and authentication.

{
  "url": "https://files.company.com/download/file.zip",
  "method": "GET"
}

πŸ“ Logs

  • All events are logged in HttpProxyServer.log.
  • Levels: debug, info, warning, error.
  • Example:
    2026-01-15 20:49:00,123 [INFO] __main__ - Application initialized successfully
    2026-01-15 20:49:01,456 [INFO] __main__ - Starting service health check
    

πŸ›‘ How to stop the server?

  • Task Manager: Ctrl+Shift+Esc β†’ find HttpProxyServer.exe β†’ end process
  • Command line: taskkill /f /im HttpProxyServer.exe
  • PowerShell: Get-Process -Name "HttpProxyServer" | Stop-Process -Force

πŸŒ€ Typical workflow example

  1. Create session: POST /subscribe
  2. Login to external system using /forward:
    curl -X POST "http://localhost:8000/forward" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://system.company.com/login",
        "method": "POST",
        "data": {
          "username": "my_user",
          "password": "my_password"
        },
        "headers": { "Content-Type": "application/x-www-form-urlencoded" }
      }'
  3. Make authenticated requests: POST /forward
  4. Download files: POST /dowwnload
  5. Set custom headers: POST /set-headers
  6. Logout: POST /unsubscribe

πŸ› οΈ Troubleshooting

  • Port in use: Change the port in .env or stop the existing process.
  • Permissions: Run as administrator or use ports >1024.
  • No internet: Check network, corporate proxy, or firewall.

πŸ” Security

  • HTTPS support, robust validation, audit logging, security headers, configurable timeouts, and more.

πŸ“š Interactive documentation


Developer: Raul Mauricio UΓ±ate Castro
Version: 3.0.0
Date: January 20, 2026