VPS Proxy Command Shortcut
sudo bash -c 'set -euo pipefail; IFS=$"\n\t";
SERVER_IP="${1:-0.0.0.0}"; PORT="${2:-7474}";
echo "[+] Installing Tinyproxy on ${SERVER_IP}:${PORT}";
if command -v apt-get >/dev/null; then apt-get update -y && apt-get install -y tinyproxy nano;
elif command -v dnf >/dev/null; then dnf install -y tinyproxy nano;
elif command -v yum >/dev/null; then yum install -y tinyproxy nano;
elif command -v pacman >/dev/null; then pacman -Sy --noconfirm tinyproxy nano;
else echo "No supported package manager."; exit 1; fi;
CONF="/etc/tinyproxy/tinyproxy.conf"; [ -f "$CONF" ] && cp "$CONF" "$CONF.bak.$(date +%s)" || true;
cat > "$CONF" <<EOF
User nobody
Group nogroup
Listen ${SERVER_IP}
Port ${PORT}
Allow 0.0.0.0/0
Timeout 600
LogLevel Info
Syslog On
PidFile "/var/run/tinyproxy/tinyproxy.pid"
MaxClients 100
EOF
mkdir -p /var/log/tinyproxy /var/run/tinyproxy; chmod 755 /var/log/tinyproxy /var/run/tinyproxy;
systemctl daemon-reload || true; systemctl enable --now tinyproxy || service tinyproxy restart || true;
echo "[✓] Tinyproxy ready on ${SERVER_IP}:${PORT}";
echo "Check: curl -x http://${SERVER_IP}:${PORT} https://ifconfig.me"'
systemctl status tinyproxy