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: