-
Notifications
You must be signed in to change notification settings - Fork 0
/
mbtester.py
38 lines (36 loc) · 1.1 KB
/
mbtester.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
##\package mbtester
# \brief Simple loader mechanism for binary distributions
#
# Vegard Fiksdal (C) 2024
#
#from mbtclient import *
#from mbtserver import *
from mbtproxy import *
# Load appropriate code
print(App.getAbout()+'\n')
loader=Loader()
if loader.flags.server and loader.flags.client:
print('Server options:')
print(App.reportConfig(loader.serverargs))
print('Client options:')
print(App.reportConfig(loader.clientargs))
server=ServerObject(loader.serverargs)
client=ClientObject(loader.clientargs)
proxy=ProxyObject(server,client)
if proxy.startProxy():
proxy.server.waitServer()
elif loader.flags.server:
print(App.reportConfig(loader.serverargs))
server=ServerObject(loader.serverargs)
if server.startServer():
server.waitServer()
elif loader.flags.client:
print(App.reportConfig(loader.clientargs))
client=ClientObject(loader.clientargs)
if client.connect():
output=client.download()
output=json.dumps(output,indent=4)
print(str(output))
client.close()
else:
print('Please specify --client or --server')