From c0c2cd8f97062f9275f882007b886cce7260eacf Mon Sep 17 00:00:00 2001 From: mgeeky Date: Tue, 8 Dec 2020 08:22:09 -0800 Subject: [PATCH] small additions --- proxy2.py | 3 ++- proxylogger.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy2.py b/proxy2.py index d4b4415..a8e134e 100755 --- a/proxy2.py +++ b/proxy2.py @@ -1102,6 +1102,7 @@ def serve_proxy(bind, port, _ssl = False): except OSError as e: if 'Address already in use' in str(e): logger.err("Could not bind to specified port as it is already in use!") + return else: raise @@ -1151,7 +1152,7 @@ def main(): th.daemon = True th.start() - while True: + while any(t.is_alive() for t in threads): time.sleep(1) except KeyboardInterrupt: diff --git a/proxylogger.py b/proxylogger.py index e6caaf0..80a38f2 100755 --- a/proxylogger.py +++ b/proxylogger.py @@ -68,7 +68,8 @@ def out(txt, fd, mode='info ', **kwargs): else: col = ProxyLogger.colors_dict.setdefault(mode, ProxyLogger.colors_map['grey']) - tm = str(time.strftime("%H:%M:%S", time.gmtime())) + #tm = str(time.strftime("%H:%M:%S", time.gmtime())) + tm = str(time.strftime("%Y-%m-%d/%H:%M:%S", time.gmtime())) prefix = '' if mode: