标签归档:住宅代理负载均衡

出局为,多socks5,带认证,住宅代理,负载均衡配置 2023-08-22

段落1、需求描述

购买了多个住宅代理,每个住宅代理,因为购买自不同的商家,认证的用户名/密码都是不同的,且不知道哪个代理节点会有突发故障,为了增加稳定行,通过负载均衡的方式,将节点汇聚,实现一个超稳定的出局链路。

段落2、工具描述

因为认证信息不同的因素,工具需要支持不同的认证信息,这里,使用的是gost工具,符合这样专业化的需求。

官方项目地址:https://github.com/ginuerzh/gost

文档: https://v2.gost.run/en/load-balancing/

段落3、配置样例

配置一个入向是透明socks5协议,出向是多socks5带认证住宅的链

NOTE:使用版本 gost-2.11.5 这样的最新版本,肯定功能都是支持的

定义一个配置文件,里面包含很多个住宅代理

# FILENAME: outbound_peers.txt

# strategy - (2.6+) Specify node selection strategy, round for round-robin, random for random selection, fifo for top-down selection, the default is round
# strategy for node selecting
# 参数-负载均衡模式 可选 round random fifo
strategy  random

# max_fails - (2.8.1+) The maximum number of failed connections for a specified node, When the number of failed connections with a node exceeds this set value, the node will be marked as a Dead node, Dead node will not be selected to use. default value is 1.
# 参数-最大失败次数(判定节点失效的所需的次数),默认值为1,一般事不过三,设置为3,相对好一点
max_fails  3

# fail_timeout - (2.8.1+) Specify the dead node's timeout period. When a node is marked as a dead node, it will not be selected within this set time interval. After this set time interval, it will participate in node selection again.
# 参数-超时节点的复活延迟,单位秒数,设置为一个相对有效的秒数即可, 15s 20s这样
fail_timeout  15s

# 参数-热加载的周期,单位秒数
# period for live reloading
reload  10s

# 参数-节点的信息
# peers
peer    socks5://706de:A3421F14F1dFDF4F@xx.xx.xx.xx:27906
peer    socks5://f5c5a:3d8145Cb72c4FbD8@yy.yy.yy.yy:23018
peer    socks5://feae8:cEA28B2e21AfD54f@zz.zz.zz.zz:17294

/usr/bin/gost -L=socks5://127.0.0.1:51111 -F=socks5://?peer=/root/outbound_peers.txt

验证

curl -v -x socks5://127.0.0.1:51111 https://ifconfig.co/json

段落4、后记

目前,gost的负载均衡策略,工作模式,还是单薄,并没有其他几个工具那么丰富,胜在其有支持不同用户名/密码的功能,希望它能继续更新,支持ip_hash这样的模式。

000138. 出局为,多socks5,带认证,住宅代理,负载均衡配置 2023-08-27
本期博客地址 https://dasmz.com/?p=3428
本期视频地址 https://youtu.be/jOyeUd0Kyzs

YouTube:

附录1、

博客内,所有教程为手打原创教程,如果技术教程对您有所帮助,欢迎打赏作者

对于博客内已提及的专业知识,如果需要技术指导,欢迎联系我,仅需支付工时费

Twitter: Dasmz

Youtube: @DasmzStudio

Telegram: @Dasmz

Donate
云乞讨