Skip to content

About

Robot traffic site

Resources

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Docker Robot Traffic — Request Simulator

Python Docker Build

The Request Simulator is a Python-based application that simulates multiple concurrent HTTP requests to a list of URLs. It uses aiohttp for fully asynchronous requests and supports customizable user agents for different browsers and operating systems. Results are logged and saved to a JSON file for further analysis.


Features

  • Asynchronous Requests — sends many HTTP requests concurrently using aiohttp and asyncio.
  • Custom User Agents — predefined user-agent strings for Chrome, Firefox, and Safari across Windows, macOS, and Android.
  • Dynamic URL Loading — URLs are read from list.txt and reloaded on every cycle, so you can edit the list while the app is running.
  • Environment-Based Configuration — control the request volume and user agent with environment variables, no code changes needed.
  • Logging & Results — writes a plain-text log to request_log.txt and structured results (per-URL status) to login.json.
  • Graceful Shutdown — handles termination signals and saves results before exiting.
  • Docker Support — containerized with Docker and Docker Compose; a public image is published to GHCR automatically via GitHub Actions.

How It Works

  1. On startup, the app loads the URL list from list.txt (one URL per line).
  2. For each URL it fires TOTAL_REQUESTS simultaneous GET requests using the configured USER_AGENT.
  3. The status of every request (success/failure + HTTP code) is appended to the results.
  4. After each full cycle, results are written to login.json, the app sleeps briefly, reloads list.txt, and repeats — running continuously until stopped.

Prerequisites

  • Python 3.9+ (for running locally)
  • Docker and Docker Compose (optional, for containerized deployment)

Installation

1. Clone the Repository

git clone https://github.com/tahatehran/Docker-robot-trafice.git
cd Docker-robot-trafice

2. Prepare the URL List

Create a file named list.txt in the project root with one URL per line, for example:

https://example.com
https://example.org

3. Run the Application

Option 1 — Run Locally (Without Docker)

# Install dependencies
pip install -r requirements.txt

# Start the simulator
python main.py

Option 2 — Run with Docker Compose

# Build and run in the foreground
docker compose up --build

# Or run detached (in the background)
docker compose up --build -d

Because docker-compose.yml mounts the project directory into the container, you can edit list.txt on the host at any time and the changes are picked up on the next cycle.

To stop the application:

docker compose down

Configuration

The application is configured through environment variables (defaults are set in the Dockerfile and docker-compose.yml):

Variable Default Description
TOTAL_REQUESTS 100 Number of simultaneous requests sent per URL.
USER_AGENT chrome_windows (value) The User-Agent header sent with every request.

Example — run with 50 requests per URL and a Firefox Android user agent:

TOTAL_REQUESTS=50 USER_AGENT="Mozilla/5.0 (Android 10; Mobile; rv:89.0) Gecko/89.0 Firefox/89.0" python main.py

Predefined User Agents

Key Browser / OS
chrome_windows Chrome on Windows
firefox_windows Firefox on Windows
chrome_mac Chrome on macOS
safari_mac Safari on macOS
chrome_android Chrome on Android
firefox_android Firefox on Android

Output Files

File Description
login.json Structured results — one entry per request with url, status, and success.
request_log.txt Timestamped log of every request, warning, and error.

Docker Image

A Docker image is built and published to the GitHub Container Registry (GHCR) automatically on every push to main via GitHub Actions:

docker pull ghcr.io/tahatehran/docker-robot-trafice:latest

If the package is private, authenticate first with a GitHub token: docker login ghcr.io.


Project Structure

Docker-robot-trafice/
├── main.py               # Application entry point (RequestSimulator)
├── list.txt              # Target URLs, one per line (reloaded each cycle)
├── requirements.txt      # Python dependencies
├── Dockerfile            # Container image definition
├── docker-compose.yml    # Compose service with volume mount & env vars
├── login.json            # Output: request results (JSON)
├── request_log.txt       # Output: request log (plain text)
└── .github/workflows/    # CI: CodeQL analysis & GHCR image publishing

⚠️ Responsible Use

This tool sends repeated automated requests to web servers. Use it only on websites you own or have explicit permission to test. Sending unsolicited traffic to third-party sites may be illegal and can violate their terms of service. The authors are not responsible for misuse of this software.

About

Robot traffic site

Resources

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages