mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-16 16:03:51 +00:00
Compare commits
3 Commits
v1.1.1
...
87f4370927
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87f4370927 | ||
|
|
a978eae922 | ||
|
|
88c8c57a44 |
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:22.04
|
||||
FROM ubuntu:22.10
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y python3 python3-uvloop python3-cryptography python3-socks libcap2-bin ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
RUN setcap cap_net_bind_service=+ep /usr/bin/python3.10
|
||||
|
||||
@@ -868,6 +868,7 @@ class ProxyReqStreamReader(LayeredStreamReaderBase):
|
||||
RPC_PROXY_ANS = b"\x0d\xda\x03\x44"
|
||||
RPC_CLOSE_EXT = b"\xa2\x34\xb6\x5e"
|
||||
RPC_SIMPLE_ACK = b"\x9b\x40\xac\x3b"
|
||||
RPC_UNKNOWN = b'\xdf\xa2\x30\x57'
|
||||
|
||||
data = await self.upstream.read(1)
|
||||
|
||||
@@ -886,8 +887,11 @@ class ProxyReqStreamReader(LayeredStreamReaderBase):
|
||||
conn_id, confirm = data[4:12], data[12:16]
|
||||
return confirm, {"SIMPLE_ACK": True}
|
||||
|
||||
if ans_type == RPC_UNKNOWN:
|
||||
return b"", {"SKIP_SEND": True}
|
||||
|
||||
print_err("unknown rpc ans type:", ans_type)
|
||||
return b""
|
||||
return b"", {"SKIP_SEND": True}
|
||||
|
||||
|
||||
class ProxyReqStreamWriter(LayeredStreamWriterBase):
|
||||
@@ -1570,6 +1574,9 @@ async def tg_connect_reader_to_writer(rd, wr, user, rd_buf_size, is_upstream):
|
||||
else:
|
||||
extra = {}
|
||||
|
||||
if extra.get("SKIP_SEND"):
|
||||
continue
|
||||
|
||||
if not data:
|
||||
wr.write_eof()
|
||||
await wr.drain()
|
||||
|
||||
Reference in New Issue
Block a user