Browse Source

update: IPv6 local test

master
Dnomd343 3 years ago
parent
commit
c30966b52b
  1. 12
      ProxyTester/Shadowsocks.py
  2. 5
      ProxyTester/TrojanGo.py
  3. 4
      Test.py

12
ProxyTester/Shadowsocks.py

@ -85,9 +85,12 @@ def __ssServerConfig(method: str, plugin: str or None) -> list:
} }
caption = 'Shadowsocks method ' + method caption = 'Shadowsocks method ' + method
if method in ['plain', 'none']: # plain / none -> ss-rust if method in ['plain', 'none']: # plain / none -> ss-rust
serverAddr = testConfig['bind']
if not testConfig['bind'].find(':') < 0:
serverAddr = '[' + testConfig['bind'] + ']'
serverCommand = [ serverCommand = [
'ss-rust-server', 'ss-rust-server',
'-s', testConfig['bind'] + ':' + str(testConfig['port']), '-s', serverAddr + ':' + str(testConfig['port']),
'-k', testConfig['passwd'], '-k', testConfig['passwd'],
'-m', method '-m', method
] ]
@ -165,6 +168,8 @@ def __ssServerConfig(method: str, plugin: str or None) -> list:
# others plugin # others plugin
result = [] result = []
if plugin == 'kcptun-client' and testConfig['bind'].find(':') >= 0:
serverCommand[serverCommand.index('-s') + 1] = '[' + testConfig['bind'] + ']'
pluginConfig = sip003.loadPluginConfig( # 载入插件配置 pluginConfig = sip003.loadPluginConfig( # 载入插件配置
plugin, testConfig['host'], testConfig['cert'], testConfig['key'] plugin, testConfig['host'], testConfig['cert'], testConfig['key']
) )
@ -197,6 +202,11 @@ def test(config: dict) -> list:
testList = [] testList = []
for method in ssMethodList: # all Shadowsocks methods for method in ssMethodList: # all Shadowsocks methods
testList += __ssServerConfig(method, None) testList += __ssServerConfig(method, None)
if config['bind'].find(':') >= 0: # ipv6 format error
sip003PluginList.remove('gq-client')
sip003PluginList.remove('rabbit-plugin')
for plugin in sip003PluginList: # all SIP003 plugin for plugin in sip003PluginList: # all SIP003 plugin
testList += __ssServerConfig('aes-256-ctr', plugin) testList += __ssServerConfig('aes-256-ctr', plugin)
return testList return testList

5
ProxyTester/TrojanGo.py

@ -112,6 +112,8 @@ def loadTrojanGoPlugin(plugin: str) -> list:
# other plugin # other plugin
pluginConfig = Plugin.loadPluginConfig(plugin, testConfig['host'], testConfig['cert'], testConfig['key']) # 载入插件配置 pluginConfig = Plugin.loadPluginConfig(plugin, testConfig['host'], testConfig['cert'], testConfig['key']) # 载入插件配置
if plugin == 'kcptun-client' and testConfig['bind'].find(':') >= 0:
trojanBaseConfig['server']['local_addr'] = '[' + trojanBaseConfig['server']['local_addr'] + ']'
for pluginOption in pluginConfig: for pluginOption in pluginConfig:
trojanConfig = copy.deepcopy(trojanBaseConfig) trojanConfig = copy.deepcopy(trojanBaseConfig)
trojanConfig['caption'] = 'Trojan-Go plugin ' + plugin + ' (' + pluginOption['caption'] + ')' trojanConfig['caption'] = 'Trojan-Go plugin ' + plugin + ' (' + pluginOption['caption'] + ')'
@ -161,6 +163,9 @@ def test(config: dict) -> list:
testList += loadTrojanGoConfig([loadTrojanGo(False, ssMethod)]) # basic test with shadowsocks testList += loadTrojanGoConfig([loadTrojanGo(False, ssMethod)]) # basic test with shadowsocks
testList += loadTrojanGoConfig([loadTrojanGo(True, ssMethod)]) testList += loadTrojanGoConfig([loadTrojanGo(True, ssMethod)])
if config['bind'].find(':') >= 0: # ipv6 format error
sip003PluginList.remove('gq-client')
sip003PluginList.remove('rabbit-plugin')
for plugin in sip003PluginList: # plugin test -> cause zombie process (imperfect trojan-go) for plugin in sip003PluginList: # plugin test -> cause zombie process (imperfect trojan-go)
testList += loadTrojanGoConfig(loadTrojanGoPlugin(plugin)) testList += loadTrojanGoConfig(loadTrojanGoPlugin(plugin))

4
Test.py

@ -11,8 +11,8 @@ import Check as Checker
import ProxyTester as Tester import ProxyTester as Tester
testConfig = { testConfig = {
'bind': '0.0.0.0', 'bind': '::1',
'addr': '172.17.0.2', 'addr': '::1',
'port': 12345, 'port': 12345,
'passwd': 'dnomd343', 'passwd': 'dnomd343',
'host': 'local.343.re', 'host': 'local.343.re',

Loading…
Cancel
Save