代理服务器多个 IP

代理服务器多个 IP

您好,我想托管大量 SOCK5 代理,想知道是否有任何软件/Linux 版本适合在某个实例上托管一段时间子网的代理。所以我想在一台机器上大约有 256 个 ipv4,最好的方法是什么?

我研究过 Dante,但想知道是否有更好的多代理软件?

答案1

很好。让我们开始吧 :) 试试这个,应该对你有用。

首先,解决方案基于乌贼

安装后,显然我们将修改该squid.conf文件。我们将使用以下配置指令:

http_port
name=
myportname
acl
http_access
tcp_outgoing_address

首先,我们要告诉 Squid 要监听哪些 IP 和端口,并且我们要使用name=带有以下选项http_port

# 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。

下一步。如果您希望进行基本身份验证,则必须执行以下操作

我们将创建一个文件来存储密码并更改其所有权,以便 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

尝试。

相关内容