From 72700075ef060f94cf7a0942200b84fe64a3625d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 15 Mar 2022 16:33:15 +0100 Subject: [PATCH] Small tunnel fix --- tunnel-server/src/uds_tunnel/proxy.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tunnel-server/src/uds_tunnel/proxy.py b/tunnel-server/src/uds_tunnel/proxy.py index 82dbf7d7..fdf2c8df 100644 --- a/tunnel-server/src/uds_tunnel/proxy.py +++ b/tunnel-server/src/uds_tunnel/proxy.py @@ -53,7 +53,15 @@ class Proxy: # Method responsible of proxying requests async def __call__(self, source: socket.socket, context: 'ssl.SSLContext') -> None: - await self.proxy(source, context) + try: + await self.proxy(source, context) + except Exception as e: + # get source ip address + try: + addr = source.getpeername() + except Exception: + addr = 'Unknown' + logger.error('Proxy error from %s: %s', addr, e) async def proxy(self, source: socket.socket, context: 'ssl.SSLContext') -> None: