|
@ -1,6 +1,7 @@ |
|
|
#!/usr/bin/python |
|
|
#!/usr/bin/python |
|
|
# -*- coding:utf-8 -*- |
|
|
# -*- coding:utf-8 -*- |
|
|
|
|
|
|
|
|
|
|
|
import sys |
|
|
import time |
|
|
import time |
|
|
import subprocess |
|
|
import subprocess |
|
|
|
|
|
|
|
@ -8,17 +9,11 @@ import test as Tester |
|
|
import ProxyBuilder as Builder |
|
|
import ProxyBuilder as Builder |
|
|
import ProxyChecker as Checker |
|
|
import ProxyChecker as Checker |
|
|
|
|
|
|
|
|
# print(dir(Tester)) |
|
|
defaultPort = 10808 |
|
|
|
|
|
defaultPasswd = 'dnomd343' |
|
|
|
|
|
|
|
|
data = Tester.Shadowsocks(1081, 'dnomd343') |
|
|
def startTest(testList): |
|
|
# data = Tester.ShadowsocksR(1081, 'dnomd343') |
|
|
for field in testList: |
|
|
|
|
|
|
|
|
# for field in data: |
|
|
|
|
|
# print(field['proxyInfo']) |
|
|
|
|
|
# print(field['serverCommand']) |
|
|
|
|
|
# print('') |
|
|
|
|
|
|
|
|
|
|
|
for field in data: |
|
|
|
|
|
serverProcess = subprocess.Popen( |
|
|
serverProcess = subprocess.Popen( |
|
|
field['serverCommand'], |
|
|
field['serverCommand'], |
|
|
stdout = subprocess.DEVNULL, |
|
|
stdout = subprocess.DEVNULL, |
|
@ -39,3 +34,18 @@ for field in data: |
|
|
serverProcess.terminate() # 关闭服务端 |
|
|
serverProcess.terminate() # 关闭服务端 |
|
|
time.sleep(0.1) |
|
|
time.sleep(0.1) |
|
|
print() |
|
|
print() |
|
|
|
|
|
|
|
|
|
|
|
if len(sys.argv) <= 1: |
|
|
|
|
|
print("no param") |
|
|
|
|
|
sys.exit(0) |
|
|
|
|
|
|
|
|
|
|
|
testName = sys.argv[1] |
|
|
|
|
|
if testName == 'ss': |
|
|
|
|
|
testList = Tester.Shadowsocks(defaultPort, defaultPasswd) |
|
|
|
|
|
elif testName == 'ssr': |
|
|
|
|
|
testList = Tester.ShadowsocksR(defaultPort, defaultPasswd) |
|
|
|
|
|
else: |
|
|
|
|
|
print("unknown test name") |
|
|
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
|
|
|
|
startTest(testList) |
|
|