Network path analysis tool with real-time latency visualization. Run traceroute commands from a web interface or CLI, view hop-by-hop latency data, and export results.
- Web Interface - Modern Binance-inspired dark UI with yellow accent colors
- CLI Tool - Terminal-based traceroute with text tables and optional matplotlib graphs
- Real-time Visualization - Interactive latency charts powered by Chart.js
- Network Path Display - Visual node-by-node path representation
- Demo Mode - Test the interface without running actual traceroute commands
- Export Support - JSON export for further analysis
- Backend: Python 3.8+ with Flask
- Frontend: Vanilla JavaScript, Chart.js
- CLI: Python with optional matplotlib/rich for enhanced output
- System: Linux
tracerouteor Windowstracert
- Python 3.8 or higher
traceroutecommand (Linux) or built-intracert(Windows)- pip (Python package manager)
cd /home/god/Downloads/traceroute# Server dependencies
pip install flask flask-cors
# CLI dependencies (optional)
pip install matplotlib richLinux (Ubuntu/Debian):
sudo apt-get install tracerouteLinux (Fedora/RHEL):
sudo dnf install traceroutemacOS:
brew install tracerouteWindows: Built-in tracert command (no installation needed)
# Option 1: Using the startup script
./run_server.sh
# Option 2: Direct Python execution
python3 traceroute_server.pyThe server starts at http://localhost:5000
Navigate to http://localhost:5000 in your browser and:
- Enter a target hostname or IP (e.g.,
google.com) - Click "Run Traceroute"
- View latency data, network path, and detailed results
traceroute/
├── traceroute_server.py # Flask web server
├── traceroute_visualizer.py # CLI traceroute tool
├── traceroute_visualizer.html # Web UI (Binance design)
├── run_server.sh # Startup script
├── screenshot.png # Screenshot of WebUI
└── README.md # This file
| File | Purpose |
|---|---|
traceroute_server.py |
Flask server with /api/traceroute endpoint, serves static HTML |
traceroute_visualizer.py |
CLI tool with text/rich tables, matplotlib graphs, JSON export |
traceroute_visualizer.html |
Standalone frontend (Chart.js), calls API endpoints |
run_server.sh |
Startup script with dependency checks |
- User enters target in web form
- Frontend sends
GET /api/traceroute?target=<host> - Server runs system
traceroutecommand - Output parsed into hop dictionaries
- JSON response rendered in UI
User Input → Flask API → subprocess(traceroute) → Parse Output → JSON Response
↓
Chart.js + DOM Update ← Frontend
# Start server
python3 traceroute_server.py
./run_server.sh# Basic text output
python3 traceroute_visualizer.py google.com
# With latency graph (requires matplotlib)
python3 traceroute_visualizer.py google.com --graph
# With network map visualization
python3 traceroute_visualizer.py google.com --map
# All visualizations
python3 traceroute_visualizer.py google.com --all
# Demo mode with sample data
python3 traceroute_visualizer.py --demo --graph
# Export to JSON
python3 traceroute_visualizer.py google.com --export results.json| Variable | Description | Default |
|---|---|---|
FLASK_ENV |
Flask environment | development |
FLASK_PORT |
Server port | 5000 |
FLASK_HOST |
Server host | 0.0.0.0 |
Run traceroute on target host.
Parameters:
| Parameter | Type | Description |
|---|---|---|
target |
string | Hostname or IP address (required) |
Response:
{
"hops": [
{
"hop": 1,
"ip": "192.168.1.1",
"times": [1.2, 1.1, 1.3],
"avg_time": 1.2
}
]
}Health check endpoint.
Response: {"status": "ok"}
# Test server health
curl http://localhost:5000/api/health
# Run demo traceroute
curl "http://localhost:5000/api/traceroute?target=google.com"
# CLI test (requires traceroute installed)
python3 traceroute_visualizer.py --demo --graphLinux:
sudo apt-get install traceroute # Debian/Ubuntu
sudo dnf install traceroute # Fedora/RHELmacOS:
brew install tracerouteWindows: Use built-in tracert (no installation needed)
pip install flask flask-corsChange the port in traceroute_server.py:
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080) # Change portEnsure flask-cors is installed and enabled:
from flask_cors import CORS
CORS(app, resources={r"/*": {"origins": "*"}})pip install matplotlib
# Or run without --graph flag
python3 traceroute_visualizer.py google.comFROM python:3.11-slim
RUN apt-get update && apt-get install -y traceroute
WORKDIR /app
COPY *.py *.html requirements.txt ./
RUN pip install -r requirements.txt
EXPOSE 5000
CMD ["python3", "traceroute_server.py"]- Rate Limiting: Add request throttling to
/api/traceroute - Authentication: Protect API endpoint for private deployments
- Timeout: Increase subprocess timeout for long routes
- Logging: Add structured logging for production monitoring
MIT License - See project for details.
