使 HTTP 和 HTTPS 的轮换代理
Make rotating proxies both HTTP and HTTPS
我正在使用来自 GitHub -> https://github.com/mattes/rotating-proxy
的遮罩旋转代理 docker 容器
我已经正确设置了所有内容,运行 非常完美。
但是,它仅充当 HTTPS 代理,而不是 HTTP 和 HTTPS。
我已经更改了 HAProxy 配置文件并将 mode
从 http
设置为 tcp
但它仍然只是 HTTPS。
这是我当前的 haproxy.cfg.erb
文件,后来使用 Ruby 脚本更改为 haproxy.cfg
:
global
maxconn 1024000
daemon
pidfile <%= pid_file %>
defaults
mode tcp
maxconn 1024000
option tcplog
option dontlognull
retries 3
timeout connect 5s
timeout client 60s
timeout server 60s
listen stats *:4444
mode http
log global
maxconn 1024000
clitimeout 100s
srvtimeout 100s
contimeout 100s
timeout queue 100s
stats enable
stats hide-version
stats refresh 30s
stats show-node
stats uri /haproxy?stats
frontend rotating_proxies
bind *:<%= port %>
mode tcp
default_backend tor
option http_proxy
option tcplog
backend tor
option http_proxy
option tcplog
mode tcp
balance leastconn # http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#balance
<% backends.each do |b| %>
server <%= b[:name] %><%= b[:port] %> <%= b[:addr] %>:<%= b[:port] %>
<% end %>
我正在使用 http://www.checker.freeproxy.ru/checker/,它说代理类型仅为 HTTPS。
如有任何帮助,我们将不胜感激。
谢谢!
在您的后端 tor
您有这个选项:
option http_proxy
您必须删除此行。此外,您使用的这个代理检查器将始终显示 HTTPS
,因为这是一个旋转代理客户端。
您向我们尝试的所有脚本(TOR 轮换代理)只是使用 TOR 网桥为您在每个请求上获得一个新代理。
好吧,您必须知道 TOR 只是 SOCKS,这在您尝试使用的 GitHub 存储库的自述文件中很清楚。
Please note: Tor offers a SOCKS Proxy only. In order to allow
communication from HAproxy to Tor, Polipo is used to translate from
HTTP proxy to SOCKS proxy. HAproxy is able to talk to HTTP proxies
only.
@usamember 的回答完全没用,您可能会注意到按照他的回答您已经破坏了 HAProxy 配置。现在您应该收到“504:连接被拒绝”
但是,还有一种替代 TOR 的方法。请参阅此 GitHub 存储库:https://github.com/jgontrum/proxies-rotator
它使用 GimmeProxy.com 的 API 获取代理并在您的客户端上轮换它们。所以这是 TOR
的替代品
我正在使用来自 GitHub -> https://github.com/mattes/rotating-proxy
的遮罩旋转代理 docker 容器我已经正确设置了所有内容,运行 非常完美。
但是,它仅充当 HTTPS 代理,而不是 HTTP 和 HTTPS。
我已经更改了 HAProxy 配置文件并将 mode
从 http
设置为 tcp
但它仍然只是 HTTPS。
这是我当前的 haproxy.cfg.erb
文件,后来使用 Ruby 脚本更改为 haproxy.cfg
:
global
maxconn 1024000
daemon
pidfile <%= pid_file %>
defaults
mode tcp
maxconn 1024000
option tcplog
option dontlognull
retries 3
timeout connect 5s
timeout client 60s
timeout server 60s
listen stats *:4444
mode http
log global
maxconn 1024000
clitimeout 100s
srvtimeout 100s
contimeout 100s
timeout queue 100s
stats enable
stats hide-version
stats refresh 30s
stats show-node
stats uri /haproxy?stats
frontend rotating_proxies
bind *:<%= port %>
mode tcp
default_backend tor
option http_proxy
option tcplog
backend tor
option http_proxy
option tcplog
mode tcp
balance leastconn # http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#balance
<% backends.each do |b| %>
server <%= b[:name] %><%= b[:port] %> <%= b[:addr] %>:<%= b[:port] %>
<% end %>
我正在使用 http://www.checker.freeproxy.ru/checker/,它说代理类型仅为 HTTPS。
如有任何帮助,我们将不胜感激。
谢谢!
在您的后端 tor
您有这个选项:
option http_proxy
您必须删除此行。此外,您使用的这个代理检查器将始终显示 HTTPS
,因为这是一个旋转代理客户端。
您向我们尝试的所有脚本(TOR 轮换代理)只是使用 TOR 网桥为您在每个请求上获得一个新代理。
好吧,您必须知道 TOR 只是 SOCKS,这在您尝试使用的 GitHub 存储库的自述文件中很清楚。
Please note: Tor offers a SOCKS Proxy only. In order to allow communication from HAproxy to Tor, Polipo is used to translate from HTTP proxy to SOCKS proxy. HAproxy is able to talk to HTTP proxies only.
@usamember 的回答完全没用,您可能会注意到按照他的回答您已经破坏了 HAProxy 配置。现在您应该收到“504:连接被拒绝”
但是,还有一种替代 TOR 的方法。请参阅此 GitHub 存储库:https://github.com/jgontrum/proxies-rotator
它使用 GimmeProxy.com 的 API 获取代理并在您的客户端上轮换它们。所以这是 TOR
的替代品