Improved bootloader telem logging, added docs about monkeyzoo tunneling machine used in tests

This commit is contained in:
VakarisZ 2020-03-16 12:07:17 +02:00
parent 586057df74
commit f82b56fca6
2 changed files with 18 additions and 18 deletions

View File

@ -559,17 +559,13 @@ fullTest.conf is a good config to start, because it covers all machines.
<td>OS:</td>
<td><strong>Windows server 2019 x64</strong></td>
</tr>
<tr class="even">
<td>Software:</td>
<td>OpenSSL</td>
</tr>
<tr class="odd">
<td>Default services port:</td>
<td>445</td>
</tr>
<tr class="even">
<td>Root password:</td>
<td>:t67TC5ZD+mz</td>
<td>t67TC5ZDmz</td>
</tr>
<tr class="odd">
<td>Servers config:</td>

View File

@ -112,21 +112,25 @@ class HTTPConnectProxyHandler(http.server.BaseHTTPRequestHandler):
proxy_via = None # pseudonym of the proxy in Via header, set to None not to modify original Via header
def do_POST(self):
content_length = int(self.headers['Content-Length'])
post_data = self.rfile.read(content_length).decode()
try:
r = requests.post(url=self.path, data=post_data)
except requests.exceptions.ConnectionError as e:
LOG.error("Couldn't forward request to the island: {}".format(e))
return self.send_response(404)
if r.status_code != 200:
# somehow forward post request to the next proxy
r = requests.post(url=self.path, data=post_data, proxy=self.path)
if (r.status_code != 200):
content_length = int(self.headers['Content-Length'])
post_data = self.rfile.read(content_length).decode()
LOG.info("Received bootloader's request: {}".format(post_data))
try:
r = requests.post(url=self.path, data=post_data)
except requests.exceptions.ConnectionError as e:
LOG.error("Couldn't forward request to the island: {}".format(e))
return self.send_response(404)
self.send_response(200)
self.end_headers()
self.wfile.write(r.content)
if r.status_code != 200:
# somehow forward post request to the next proxy
r = requests.post(url=self.path, data=post_data, proxy=self.path)
if (r.status_code != 200):
return self.send_response(404)
self.send_response(200)
self.end_headers()
self.wfile.write(r.content)
except Exception as e:
LOG.error("Failed receiving bootloader telemetry: {}".format(e))
def version_string(self):
return ""