A minimal Fastify server that streams the output of the uptime command to a web page in real time via WebSocket.
- Live system uptime displayed in the browser
- Fastify server with WebSocket support
- Simple, responsive HTML frontend
-
Install dependencies:
npm install
-
Run the server:
npm start
-
Visit http://localhost:3000 to see live uptime updates.
Quickstart:
docker run --name uptime -v /proc/uptime:/proc/uptime -p 3000:3000 kamaranl/uptime...or build yourself and run with Docker:
docker build -t uptime .
docker run --name uptime -v /proc/uptime:/proc/uptime -p 3000:3000 uptimeexample config:
# /etc/nginx/conf.d/default.conf
server {
listen 80 default_server;
listen 443 default_server ssl;
server_name _;
http2 on;
ssl_certificate /etc/ssl/certs/default.crt;
ssl_certificate_key /etc/ssl/private/default_key;
location / {
proxy_pass http://uptime:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffering off;
proxy_request_buffering off;
}
location /ws {
proxy_pass http://uptime:3000/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Origin '';
}
}MIT © 2025 Kamaran Layne