#!/bin/bash
# Update system
apt-get update
apt-get upgrade -y
# Install required packages
apt-get install -y build-essential libssl-dev curl wget git
# Install Node.js
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install Nginx
apt-get install -y nginx
# Configure Nginx for WebSocket
cat << EOF > /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host \$host;
proxy_cache_bypass \$http_upgrade;
}
}
EOF
# Restart Nginx
systemctl restart nginx
# Install SlowDNS
wget https://github.com/tai-lab/slowdns/releases/download/v0.0.1/slowdns-linux-amd64-v0.0.1.zip
unzip slowdns-linux-amd64-v0.0.1.zip
chmod +x slowdns
mv slowdns /usr/local/bin/
# Create configuration file for SlowDNS
cat << EOF > /etc/slowdns.conf
# SlowDNS configuration file
# Listen on port 5353
listen = :5353
# Forward all DNS queries to Google DNS
upstream = 8.8.8.8:53
EOF
# Start SlowDNS
nohup slowdns -config /etc/slowdns.conf &
install.sh, and execute it with sudo bash install.sh.Thanks so much. The slowdns link not working. Check my attachment. ThanksSure, I can help you with that. Here's a simple bash script that will work on both Ubuntu and Debian to install and configure a VPS (Virtual Private Server) for WebSocket and SlowDNS:
Code:#!/bin/bash # Update system apt-get update apt-get upgrade -y # Install required packages apt-get install -y build-essential libssl-dev curl wget git # Install Node.js curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs # Install Nginx apt-get install -y nginx # Configure Nginx for WebSocket cat << EOF > /etc/nginx/sites-available/default server { listen 80 default_server; listen [::]:80 default_server; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host \$host; proxy_cache_bypass \$http_upgrade; } } EOF # Restart Nginx systemctl restart nginx # Install SlowDNS wget https://github.com/tai-lab/slowdns/releases/download/v0.0.1/slowdns-linux-amd64-v0.0.1.zip unzip slowdns-linux-amd64-v0.0.1.zip chmod +x slowdns mv slowdns /usr/local/bin/ # Create configuration file for SlowDNS cat << EOF > /etc/slowdns.conf # SlowDNS configuration file # Listen on port 5353 listen = :5353 # Forward all DNS queries to Google DNS upstream = 8.8.8.8:53 EOF # Start SlowDNS nohup slowdns -config /etc/slowdns.conf &
This script will update the system, install required packages, configure Nginx for WebSocket, install SlowDNS, and start SlowDNS. You can save this script to a file, e.g.install.sh, and execute it withsudo bash install.sh.
Note that you may need to modify the Nginx configuration or the SlowDNS configuration to suit your needs. For example, you may need to change the WebSocket port or the DNS upstream server. Also, make sure to secure your VPS and follow best practices for server administration.

I apologize for the inconvenience. It seems that the link to the SlowDNS download is no longer available. However, you can try installing dnsmasq as an alternative DNS server.
#!/bin/bash
# Update system
apt-get update
apt-get upgrade -y
# Install required packages
apt-get install -y build-essential libssl-dev curl wget git dnsmasq
# Install Node.js
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install Nginx
apt-get install -y nginx
# Configure Nginx for WebSocket
cat << EOF > /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host \$host;
proxy_cache_bypass \$http_upgrade;
}
}
EOF
# Restart Nginx
systemctl restart nginx
# Configure dnsmasq
cat << EOF > /etc/dnsmasq.conf
# dnsmasq configuration file
listen-address=127.0.0.1
port=5353
server=8.8.8.8
EOF
# Restart dnsmasq
systemctl restart dnsmasq
# Set dnsmasq as default DNS server
sed -i 's/#DNS=/DNS=127.0.0.1/' /etc/systemd/resolved.conf
systemctl restart systemd-resolved
# Allow dnsmasq to bind to port 5353
setcap 'cap_net_bind_service=+ep' /usr/sbin/dnsmasq
# Start dnsmasq
nohup dnsmasq &