Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
ruby find proxy method with thread
SUBMITTED BY:
Guest
DATE:
Sept. 28, 2014, 7:59 p.m.
FORMAT:
Ruby
SIZE:
702 Bytes
Raw
Download
Tweet
HITS:
995
Go to comments
Report
def
get_proxy
good
=
[]
threads
=
[]
ls_prx
=
Proxy
.
new
proxy_ls
=
ls_prx
.
get_all
proxy_ls
.
each
do
|
test_prx
|
proxy_thread
=
Thread
.
new
do
res
=
Proxy
.
new
if
res
.
test_active
(
test_prx
)
&&
!
@used_proxy
.
include?
(
test_prx
)
then
good
<<
test_prx
puts
"
#{
test_prx
}
good"
else
#puts "#{test_prx} not good"
end
threads
<<
proxy_thread
end
end
threads
.
each
do
|
thread
|
thread
.
join
end
puts
"
#{
good
}
"
return
good
.
first
end
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus