4 from threading
import *
7 def test_of_proxy_conn():
9 ips
= open('proxies.txt', 'r+')
10 ips
= ips
.read().split('\n')
11 sites
= open('sites.txt', 'r+')
12 sites
= sites
.read().split('\n')
14 proxy_pinger
= PingProxyClass
.PingProxy()
15 proxy_pinger
.timeout_sec
= 60
16 proxy_pinger
.sites_to_test
= sites
19 thread
= Thread(target
=proxy_pinger
.test_proxy_conn
, args
=[str(proxy
)])
21 threads
.append(thread
)
23 for thread
in threads
:
27 def test_of_proxy_speed():
29 ips
= open('proxies.txt', 'r+')
30 ips
= ips
.read().split('\n')
31 sites
= open('sites.txt', 'r+')
32 sites
= sites
.read().split('\n')
34 proxy_pinger
= PingProxyClass
.PingProxy()
35 proxy_pinger
.timeout_sec
= 60
36 proxy_pinger
.sites_to_test
= sites
37 for i
in range(0,30000):
38 proxy_pinger
.post_msg
= proxy_pinger
.post_msg
+ "0"
40 thread
= Thread(target
=proxy_pinger
.test_proxy_speed
, args
=[str(proxy
)])
42 threads
.append(thread
)
44 for thread
in threads
:
48 if __name__
== "__main__":