代码之家  ›  专栏  ›  技术社区  ›  Mario

使HTTP和HTTPS都成为旋转代理

  •  1
  • Mario  · 技术社区  · 8 年前

    https://github.com/mattes/rotating-proxy

    我把所有的东西都安装好了,运行得很好。

    我已经更改了HAProxy配置文件并设置了 mode http tcp 但它仍然只是HTTPS。

    haproxy.cfg.erb 更改为的文件 haproxy.cfg 稍后使用Ruby脚本:

    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。

    谢谢!

    2 回复  |  直到 8 年前
        1
  •  3
  •   protld    8 年前

    您尝试使用的所有脚本(TOR旋转代理)都只是使用TOR桥在每个请求上为您获取一个新代理。

    好吧,你必须知道TOR只是SOCKS,这在你试图使用的GitHub存储库的自述文件中是清楚的。

    请注意:Tor只提供袜子代理。为了允许 从HAproxy到Tor的通信,Polipo用于从 HTTP代理到SOCKS代理。HAproxy能够与HTTP代理进行通信 只有。

    而@usamember的答案是完全无用的,您可能会注意到,您已经通过遵循他的答案打破了您的HAProxy配置。现在您应该收到“504:连接被拒绝”


    然而,有一个替代TOR的方法。查看这个GitHub存储库: https://github.com/jgontrum/proxies-rotator

        2
  •  0
  •   usamember    8 年前

    在你的后台 tor 您可以选择:

    option http_proxy
    

    HTTPS 因为这是一个旋转代理客户端。