代理服务器多个IP
您好我想要托管很多SOCK5代理,并且想知道是否有任何软件/ Linux版本可以适合在一次实例上托管代理一段子网。 所以我想在一台机器上大约需要256个ipv4,最好的方法是什么?
我已经调查了但丁,但想知道是否有更好的软件多代理?
好。 让我们开始:)尝试这个,应该适合你。
首先,解决方案基于鱿鱼 。
显然,在安装之后,我们将修改squid.conf
文件。 我们将使用以下配置指令:
http_port name= myportname acl http_access tcp_outgoing_address
首先,我们想告诉Squid要监听的IP和端口,并且我们想要使用http_port
的name=
选项:
# Squid normally listens to port 3128 http_port xx.xxx.xxx.111:3128 name=3128 http_port xx.xxx.xxx.112:3129 name=3129 http_port xx.xxx.xxx.113:3130 name=3130 http_port xx.xxx.xxx.114:3131 name=3131 http_port xx.xxx.xxx.115:3132 name=3132 http_port xx.xxx.xxx.116:3133 name=3133
我们刚刚要求Squid监听顺序端口并为每个入站连接指定一个名称。 现在我们已经命名了入站连接,我们可以根据每个入站连接名称指定一个ACL
并为每个入站连接分配一个出局IP
:
acl tasty3128 myportname 3128 src yy.yyy.yyy.0/24 http_access allow tasty3128 tcp_outgoing_address xx.xxx.xxx.111 tasty3128 acl tasty3129 myportname 3129 src yy.yyy.yyy.0/24 http_access allow tasty3129 tcp_outgoing_address xx.xxx.xxx.112 tasty3129 acl tasty3130 myportname 3130 src yy.yyy.yyy.0/24 http_access allow tasty3130 tcp_outgoing_address xx.xxx.xxx.113 tasty3130 acl tasty3131 myportname 3131 src yy.yyy.yyy.0/24 http_access allow tasty3131 tcp_outgoing_address xx.xxx.xxx.114 tasty3131 acl tasty3132 myportname 3132 src yy.yyy.yyy.0/24 http_access allow tasty3132 tcp_outgoing_address xx.xxx.xxx.115 tasty3132 acl tasty3133 myportname 3133 src yy.yyy.yyy.0/24 http_access allow tasty3133 tcp_outgoing_address xx.xxx.xxx.116 tasty3133
而已。 您现在应该能够通过Squid连接到任何已配置的IP地址。
在示例中,我只使用6个ip。
下一个。 如果您希望进行基本身份validation,则必须执
我们将创建一个文件来存储密码并更改其所有权,以便Squid可以访问。
sudo touch /etc/squid/passwd sudo chown squid /etc/squid/passwd
假设john
是我们访问Squid代理服务器的用户名,我们将使用此命令为该用户名生成密码。 您需要输入密码并再次重新输入以进行确认。 此命令中的-d
参数将强制htpasswd
使用密码的CRYPT
加密。
sudo htpasswd -d /etc/squid/squid_passwd john New password: Re-type new password: Adding password for user john
要测试用户名和密码是否输入此命令,请在以下文件中输入按空格分隔的用户名和密码。
/usr/lib64/squid/ncsa_auth /etc/squid/passwd john pass OK
打开Squid配置文件,并将以下行添加到文件顶部。
auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwd auth_param basic children 5 acl ncsa_users proxy_auth REQUIRED http_access allow ncsa_users https_access allow ncsa_users
更改后重启服务
sudo service squid restart
尝试。