socks test implementation
[Proxy-and-VPN-Tester.git] / experimental.py
blobc67572b784417b42cfea5e4b8effd46074c52914
2 import PingProxyClass
4 from threading import *
7 def test_of_proxy_conn():
8 threads = []
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
18 for proxy in ips:
19 thread = Thread(target=proxy_pinger.test_proxy_conn, args=[str(proxy)])
20 thread.start()
21 threads.append(thread)
23 for thread in threads:
24 thread.join()
27 def test_of_proxy_speed():
28 threads = []
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"
39 for proxy in ips:
40 thread = Thread(target=proxy_pinger.test_proxy_speed, args=[str(proxy)])
41 thread.start()
42 threads.append(thread)
44 for thread in threads:
45 thread.join()
48 if __name__ == "__main__":
50 test_of_proxy_conn()
51 input('Finished')