Skip to content

Commit 93a0d05

Browse files
committed
fix bug
1 parent 6c7f0f8 commit 93a0d05

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pproxy/server.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def __init__(self, lbind=None):
158158
self.udpmap = {}
159159
@property
160160
def direct(self):
161-
return isinstance(self, ProxyDirect)
161+
return type(self) is ProxyDirect
162162
def logtext(self, host, port):
163163
return '' if host == 'tunnel' else f' -> {host}:{port}'
164164
def match_rule(self, host, port):
@@ -315,7 +315,12 @@ async def drain():
315315
remote_addr = writer._transport.protocol._quic._network_paths[0].addr
316316
writer.get_extra_info = dict(peername=remote_addr, sockname=remote_addr).get
317317
writer.drain = drain
318-
writer.close = writer.write_eof
318+
def close():
319+
try:
320+
writer.write_eof()
321+
except Exception:
322+
pass
323+
writer.close = close
319324
async def wait_open_connection(self, *args):
320325
if self.handshake is not None:
321326
if not self.handshake.done():

0 commit comments

Comments
 (0)