mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Sample proxies to avoid overloading single proxy
This commit is contained in:
parent
2e99642173
commit
2be43c17ab
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ def make_client(url, proxies = {} of String => Array({ip: String, port: Int32}),
|
|||
client.connect_timeout = 10.seconds
|
||||
|
||||
if region
|
||||
proxies[region]?.try &.each do |proxy|
|
||||
proxies[region]?.try &.sample(40).each do |proxy|
|
||||
begin
|
||||
proxy = HTTPProxy.new(proxy_host: proxy[:ip], proxy_port: proxy[:port])
|
||||
client.set_proxy(proxy)
|
||||
|
|
Loading…
Reference in a new issue