bạn có thể chỉ tôi đơn giản tạo 100 proxy từ vps aws và vtrul dùng ổn định sống trong…
- User
bạn có thể chỉ tôi đơn giản tạo 100 proxy từ vps aws và vtrul dùng ổn định sống trong 24h sau ngày mới tự động tạo proxy mới thay thế
Assistant
Để tạo 100 proxy tự động thay đổi hàng ngày trên AWS VPS kết hợp V2Ray, làm theo các bước sau:
1. Chuẩn bị AWS VPS
-
Tạo EC2 Instance:
- OS: Ubuntu 22.04 LTS
- Instance type: t2.medium (đủ RAM xử lý 100 proxy)
- Security Group: Mở port SSH (22) và dải port 10000-10099 (cho 100 proxy)
-
Kết nối SSH:
ssh -i "your-key.pem" ubuntu@your-ec2-public-ip
2. Cài đặt V2Ray
sudo su bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)3. Tạo Script Tự Động
Tạo file cấu hình và cron job:
mkdir ~/v2ray-config cd ~/v2ray-config nano setup_proxy.shDán nội dung sau vào
setup_proxy.sh:#!/bin/bash # Tạo cấu hình V2Ray mới CONFIG_FILE="/usr/local/etc/v2ray/config.json" PORTS_START=10000 PORTS_END=10099 TODAY=$(date +"%Y%m%d") # Tạo UUID mới NEW_UUID=$(cat /proc/sys/kernel/random/uuid) # Xây dựng cấu hình echo '{ "inbounds": [' > $CONFIG_FILE for PORT in $(seq $PORTS_START $PORTS_END); do echo ' { "port": '$PORT', "protocol": "socks", "settings": { "auth": "password", "accounts": [ { "user": "user_'$PORT'", "pass": "'$(tr -dc A-Za-z0-9 </dev/urandom | head -c 12)'" } ], "udp": true } },' >> $CONFIG_FILE done # Xóa dấu phẩy cuối cùng sed -i '$ s/,$//' $CONFIG_FILE echo ' ], "outbounds": [{ "protocol": "freedom", "settings": {} }] }' >> $CONFIG_FILE # Khởi động lại V2Ray systemctl restart v2ray # Xuất danh sách proxy PROXY_FILE="proxies_$TODAY.txt" for PORT in $(seq $PORTS_START $PORTS_END); do echo "socks5://user_$PORT:$(grep -A1 "user_$PORT" $CONFIG_FILE | grep -o '"pass": "[^"]*' | cut -d'"' -f4)@$(curl -s ifconfig.me):$PORT" >> $PROXY_FILE doneCấp quyền thực thi:
chmod +x setup_proxy.sh4. Lên lịch tự động với Cron
crontab -eThêm dòng sau (chạy lúc 00:00 hàng ngày):
0 0 * * * /root/v2ray-config/setup_proxy.sh5. Chạy lần đầu
./setup_proxy.sh6. Lấy danh sách proxy
- File proxy được lưu tại:
~/v2ray-config/proxies_YYYYMMDD.txt - Xem danh sách:
cat ~/v2ray-config/proxies_$(date +"%Y%m%d").txt
7. Cấu hình Firewall
ufw allow 10000:10099/tcp ufw reloadKiểm tra proxy
Dùng
curlhoặc trình duyệt kiểm tra:curl --proxy socks5://user_10000:password@your-ec2-ip:10000 https://ipinfo.ioGhi chú quan trọng:
- Bảo mật: Proxy được reset password hàng ngày
- Ổn định: V2Ray duy trì kết nối ổn định
- Tự động hóa: Cron job tự chạy mỗi ngày
- Lưu trữ: File proxy mới được tạo mỗi ngày
- Giới hạn AWS: Đảm bảo VPS đủ tài nguyên xử lý 100 kết nối
⚠️ Lưu ý: Kiểm tra Security Group của AWS để chắc chắn đã mở port 10000-10099 cho TCP.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.