Skip to content

Commit 818ab9c

Browse files
committed
add backward auth
1 parent b947d05 commit 818ab9c

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

pproxy/__doc__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = "pproxy"
2-
__version__ = "2.3.1"
2+
__version__ = "2.3.2"
33
__license__ = "MIT"
44
__description__ = "Proxy server that can tunnel among remote servers by regex rules."
55
__keywords__ = "proxy socks http shadowsocks shadowsocksr ssr redirect pf tunnel cipher ssl udp"

pproxy/server.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,12 @@ async def server_run(self, handler):
243243
errwait = min(errwait*1.3 + 0.1, 30)
244244
def client_run(self, args):
245245
async def handler(reader, writer):
246-
if not self.uri.auth or self.uri.auth == (await reader.read_n(len(self.uri.auth))):
247-
await self.conn.put((reader, writer))
246+
if self.uri.auth:
247+
try:
248+
assert self.uri.auth == (await reader.read_n(len(self.uri.auth)))
249+
except Exception:
250+
return
251+
await self.conn.put((reader, writer))
248252
if self.uri.unix:
249253
return asyncio.start_unix_server(handler, path=self.uri.bind)
250254
else:

0 commit comments

Comments
 (0)