Skip to content

v2.0.0

Choose a tag to compare

@rmunate rmunate released this 16 Jan 11:04

HTTP Proxy Server - Windows Executable

πŸ“‹ Description

This project provides an HTTP proxy server compiled as a Windows executable that runs completely in the background with no visible console.

✨ Features

  • βœ… Standalone executable: No Python installation required
  • βœ… No visible console: Runs as a background service
  • βœ… Persistent sessions: Automatically maintains cookies and authentication
  • βœ… Full REST API: Endpoints for login, proxy, and health check
  • βœ… Integrated documentation: Swagger UI available at /docs
  • βœ… Detailed logging: Automatic logs in .log file
  • βœ… Optimized size: Only 11.4 MB including all dependencies

πŸš€ Quick Start

Option 1: Run directly

# Run the server (no console)
HttpProxyServer.exe

🌐 Available Endpoints

πŸ“Š Health Check

GET http://localhost:5003/health

πŸ” Login / Authentication

POST http://localhost:5003/login
Content-Type: application/json

{
  "url": "https://sistema.empresa.com/login",
  "method": "POST",
  "data": {
    "username": "user",
    "password": "password"
  },
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  }
}

πŸ”„ Proxy / Request Forwarding

POST http://localhost:5003/forward
Content-Type: application/json

{
  "url": "https://api.empresa.com/datos",
  "method": "GET",
  "headers": {
    "Accept": "application/json"
  }
}

πŸ“š Interactive Documentation

Once the server is running, access:

πŸ”§ Advanced Configuration

Environment Variables

You can configure the server using environment variables:

# Set host and port
set SERVER_HOST=0.0.0.0
set SERVER_PORT=8080

# Set logging level
set LOG_LEVEL=debug

# Enable HTTP access logs
set ACCESS_LOG=true

# Run server
HttpProxyServer.exe

Configuration File

Create a .env file in the same folder as the executable:

SERVER_HOST=0.0.0.0
SERVER_PORT=5003
LOG_LEVEL=info
ACCESS_LOG=false
RELOAD=false
WORKERS=1

πŸ“ Logs and Debugging

Log Location

  • Log file: HttpProxyServer.log (same folder as the .exe)

Log Levels

  • debug: Very detailed information
  • info: General information (default)
  • warning: Only warnings and errors
  • error: Errors only

Log Example

2026-01-15 20:49:00,123 [INFO] __main__ - FastAPI application initialized successfully
2026-01-15 20:49:00,124 [INFO] __main__ - HTTP session configured with User-Agent: Mozilla/5.0...
2026-01-15 20:49:01,456 [INFO] __main__ - Starting service health check
2026-01-15 20:49:01,789 [INFO] __main__ - Health check successful - Internet available

Stopping the Server

  1. Task Manager:

    • Ctrl + Shift + Esc
    • Find "HttpProxyServer.exe"
    • End process
  2. Command line:

    taskkill /f /im HttpProxyServer.exe
  3. PowerShell:

    Get-Process -Name "HttpProxyServer" | Stop-Process -Force

Check if Running

# Check process
tasklist | findstr HttpProxyServer

# Check connectivity
curl http://localhost:5003/health

πŸ”„ Typical Workflow

1. Authentication

curl -X POST "http://localhost:5003/login" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://sistema.empresa.com/login",
    "method": "POST",
    "data": {
      "username": "my_user",
      "password": "my_password"
    }
  }'

2. Make Authenticated Requests

curl -X POST "http://localhost:5003/forward" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://sistema.empresa.com/api/datos",
    "method": "GET"
  }'

🚨 Troubleshooting

Port Already in Use

System error when starting server: [WinError 10048]
Only one usage of each socket address (protocol/network address/port) is normally permitted

Solution:

  1. Change the port: set SERVER_PORT=8080
  2. Or terminate the existing process: taskkill /f /im HttpProxyServer.exe

Permission Error

System error when starting server: [WinError 5] Access is denied

Solution:

  1. Run as Administrator
  2. Or use a port above 1024

No Internet Connectivity

{
  "status": "Service Unavailable",
  "internet": false,
  "detail": "Timeout connecting to google.com"
}

Solution:

  1. Check your internet connection
  2. Check corporate proxy configuration
  3. Check firewall

πŸ” Security

  • βœ… SSL/TLS: Full HTTPS support
  • βœ… Input validation: Robust validation with Pydantic V2
  • βœ… Audit logging: Complete record of all operations
  • βœ… Security headers: User-Agent and corporate headers
  • βœ… Timeouts: Configurable to prevent DoS attacks

πŸ“ž Support

For issues or questions:

  1. Check the logs in HttpProxyServer.log
  2. Review the documentation at /docs
  3. Contact the developer: Raul Mauricio UΓ±ate Castro

πŸ“ Developing New Features

  1. Clone the repository
git clone .....
cd http-proxy-server
  1. Create a virtual environment and install dependencies
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
  1. Modify the code in server.py

Version: 2.0.0
Date: January 15, 2026
Compatible with: Windows 10/11, Server 2016+