mtr-web is a WebSockets-based frontend for mtr, built with Flask (Python), AngularJS, and angular-websocket, allowing you to ping/traceroute a network from a remote HTTP server. This is a useful diagnostic tool while making changes to your own network configuration.
sudo apt-get install mtr virtualenv python-pip
git clone https://github.com/kd7lxl/mtr-web.git
cd mtr-web
virtualenv env
source env/bin/activate
pip install Flask-Sockets gunicorn
gunicorn -k flask_sockets.worker mtr-web:app
server {
listen 80;
listen [::]:80;
server_name trace.hamwan.net;
location / {
proxy_pass http://127.0.0.1:8000;
}
location /mtr {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}