A Bun-based anonymous HTTP/HTTPS proxy server that provides secure and flexible proxy capabilities with IP-based access control.
- Supports both HTTP and HTTPS traffic
- No traffic decryption
- Anonymous proxy functionality
- IP-based access control through configurable whitelist
- Easy configuration via environment variables
- Lightweight and fast
- Bun 1.3.2 or higher
-
Install bun environment into your home dir (if needed):
curl -fsSL https://bun.sh/install | bash -
Clone the repository:
git clone <repository-url> cd deus-proxy-server-ts
Create a config.json file in the root directory with the following variables. Choose proxy server port and allowed IPs to access proxy:
{
"port": "8080",
"allowed_ips": "52.167.144.238,52.167.144.*,192.168.1.*,10.0.0.0/24"
}
PORT: The port number on which the proxy server will listen (default: 32000)ALLOWED_IPS: Comma-separated list of IP addresses or IP ranges that are allowed to use the proxy. Supports:- Individual IPs:
192.168.1.100 - IP wildcards:
192.168.1.* - CIDR notation:
10.0.0.0/24
- Individual IPs:
Start the proxy server:
bun run proxy.tsThe proxy server will start on the configured port and only accept connections from the specified allowed IP addresses.
For production deployment, use PM2 to manage the proxy server.
-
Create ecosystem.config.js:
// ecosystem.config.js module.exports = { apps: [{ name: 'deus-proxy', script: '/var/proxy.ts', interpreter: '/home/.bun/bin/bun', interpreter_args: 'run', exec_mode: 'fork', instances: 1, autorestart: true, watch: false, env: { NODE_ENV: 'production', PORT: 33000, ALLOWED_IPS: '5.7.7.7' } }] }; -
Start the proxy server with PM2 using custom ecosystem file:
pm2 start ecosystem.config.js -
Manage your proxy server using:
# View process status pm2 status # View logs pm2 logs deus-proxy # Stop the proxy server pm2 stop deus-proxy # Start the proxy server pm2 start deus-proxy # Restart the proxy server pm2 restart deus-proxy
# Save the current PM2 configuration
pm2 save
# Start PM2 on system boot
pm2 startup
# Monitor the proxy server
pm2 monit
2025 [ ivan deus ]