fix: terminate proxy connection on timeout or socket error

This commit is contained in:
baoweise-bot
2026-06-05 00:55:59 +08:00
parent ff9d264f3c
commit f6f448b596
+1 -1
View File
@@ -165,7 +165,7 @@ def relay(left: socket.socket, right: socket.socket) -> None:
sockets = [left, right]
while True:
readable, _, errored = select.select(sockets, [], sockets, 120)
if errored:
if errored or not readable:
return
for source in readable:
target = right if source is left else left