From 69a3c5f3234c8a690286029e200f88ac8813f63a Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 14 Nov 2024 16:47:09 +0900 Subject: [PATCH] Update server.py --- server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 4a8972d..ed65225 100644 --- a/server.py +++ b/server.py @@ -140,7 +140,7 @@ def conn_string(conn: socket.socket, data: bytes, addr: bytes): return False # debugging - logger.debug("@ " + str(addr)) + logger.debug("@ " + ("%s:%s" % addr)) logger.debug("> " + str(data)) # JSON-RPC 2.0 request over Socket (stateful) @@ -625,13 +625,13 @@ def proxy_server( logger.info("[*] Connecting...") connector.connect(conn, data, webserver, port, scheme, method, url) else: - raise Exception("Unsupported connection type") + raise Exception("[*] The request from " + ("%s:%s" % addr) + " is ignored due to an undefined connector type.") logger.info("[*] Request and received. Done. %s" % (str(addr[0]))) conn.close() except Exception as e: print(traceback.format_exc()) - logger.error("[*] Exception on requesting the data.", exc_info=e) + logger.warning("[*] Ignored the request.", exc_info=e) conn.sendall(b'HTTP/1.1 403 Forbidden\r\n\r\n{"status":403}') conn.close()