搭建免费节点池

项目地址:ssrlive/proxypool

功能:自动抓取设定好源的节点,自动测试节点的可用性,还可以自动测速

准备条件:

  • 域名一个,并已做好解析,以 proxy.yj2022.ga 为例

  • 服务器一台

演示站

这里感谢 Quorecs 大佬提供的悉尼服务器

https://xini.yj2022.ga

https://proxies.narutos.top

搭建步骤

1. 安装docker,以ubuntu为例

其他版本请参考 这里

apt-get remove docker docker-engine docker.io containerd runc
apt-get update && apt-get install -y ca-certificates curl gnupg lsb-release
mkdir -p /etc/apt/keyrings && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
curl -L https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose

2.创建一个程序运行的目录

mkdir proxypool && cd proxypool
# 下载配置文件和资源文件
wget -P config/ https://raw.githubusercontent.com/ssrlive/proxypool/master/config/config.yaml
wget -P config/ https://raw.githubusercontent.com/ssrlive/proxypool/master/config/source.yaml
# 配置proxypool的docker运行文件
cat > docker-compose.yml <<EOF
version: '3.3'
services:
  ssrlive-proxypool:
    restart: always
    container_name: proxypool
    ports:
      - '12580:12580'
    volumes:
      - './config/:/proxypool-src/config/'
    image: lukemin/ssrlive-proxypool
    command: "-c ./config/config.yaml"
EOF

3.修改程序的配置文件

修改 config 目录下的 config.yaml ,将文件第二行的 example.com 替换为自己的域名,例如 proxy.yj2022.ga

4.启动程序

执行 docker-compose up -d 即可启动程序,关闭程序使用 docker-compose down

5.申请ssl证书

  1. 安装acme脚本,以 Debian 系列的系统为例

    apt update && apt install -y cron socat && curl https://get.acme.sh | sh
    
  2. 注册账户

    .acme.sh/acme.sh --register-account -m abcd@qq.com
    
  3. 用80端口申请域名证书,也可以用其他方式

    .acme.sh/acme.sh --issue --standalone -d proxy.yj2022.ga
    
  4. 安装申请好的证书

    [ -d /ssl/proxy.yj2022.ga ] || mkdir -p /ssl/proxy.yj2022.ga
    .acme.sh/acme.sh --installcert -d proxy.yj2022.ga --fullchain-file /ssl/proxy.yj2022.ga/cret.crt --key-file /sslproxy.yj2022.ga/private.key
    chmod +r /ssl/proxy.yj2022.ga/cret.crt && chmod +r /ssl/proxy.yj2022.ga/private.key
    
  5. 设置acme脚本自动更新证书

    .acme.sh/acme.sh --upgrade --auto-upgrade
    

6.设置反向代理

  • 创建一个目录,用于存放nginx的docker配置文件

    mkdir /docker/nginx -p
    
  • 配置nginx的docker启动文件

    cd /docker/nginx
    
    cat > docker-compose.yml <<EOF
    services:
      nginx:
        container_name: nginx 
        image: nginx:stable-alpine3.17-slim
        restart: always
        network_mode: "host"
        volumes:
          - /ssl:/ssl:ro
          - ./log:/var/log/nginx
          - ./conf/:/etc/nginx/conf.d/:ro
          - ./html:/usr/share/nginx/html
    EOF
    
  • 配置反向代理配置文件

    cat > conf/proxypool.conf <<\EOF
    server {
            listen  443 ssl http2;
            server_name     proxy.yj2022.ga;
            #ssl
            ssl_protocols TLSv1.2 TLSv1.3;
            ssl_certificate      /ssl/proxy.yj2022.ga/cret.crt;
            ssl_certificate_key  /ssl/proxy.yj2022.ga/private.key;
            ssl_session_cache    shared:SSL:1m;
            ssl_session_timeout  5m;
            ssl_ciphers  HIGH:!aNULL:!MD5;
            ssl_prefer_server_ciphers  on;
            location / {
                proxy_pass http://172.17.0.1:12580;
                proxy_set_header Host $http_host;
                proxy_set_header      Upgrade $http_upgrade;
     
            }
    }
    EOF
    
  • 启动nginx

    docker-compose up -d
    
  • 这时就可以通过访问 https://proxy.yj2022.ga 来访问刚才搭建好的代理池

抓取源配置

type后面的名字不能改,例如 - type: tgchannel 后面的 tgchannel 就不能改

1.爬虫类型

  • telegram频道

- type: tgchannel
  options:
    channel: sharecentrepro #频道链接(例如:https://t.me/s/sharecentrepro) 后面的 "sharecentrepro"
    num: 200
  • 网站爬虫

# 某个网站抓取
- type: web-freessrxyz
  options:
    url: 

# 网页模糊抓取
- type: webfuzz
  options:
    url: https://merlinblog.xyz/wiki/freess.html
  • 论坛爬虫
# 翻墙党论坛抓取
- type: web-fanqiangdang
  options:
    url: https://fanqiangdang.com/forum-48-1.html

2.订阅链接类型

  • 杂合订阅

# 模糊抓取订阅链接
- type: webfuzzsub
  options:
    url: https://raw.githubusercontent.com/du5/free/master/sub.list
  • clash订阅

# clash格式订阅链接
- type: clash
  options:
    url: https://raw.githubusercontent.com/du5/free/master/file/0909/Clash.yaml
  • 订阅链接
# 订阅链接_1
- type: subscribe
  options:
    url: https://sub.sharecentre.online/sub
# 订阅链接_2
- type: subscribe
  options:
    url: https://www.efcloud.cc/api/v1/client/subscribe?token=e1c8958bba066c331e85660e45893716

其他配置

查看作者的 **使用教程 **即可

Q.E.D.