Skip to content

Commit 39adbf7

Browse files
committed
fix udp bug
1 parent 476b538 commit 39adbf7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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.0.5"
2+
__version__ = "2.0.6"
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ def prepare_udp_connection(self, host, port, data):
303303
return data
304304
def start_udp_server(self, args):
305305
class Protocol(asyncio.DatagramProtocol):
306-
def connection_made(self, transport):
307-
self.transport = transport
308-
def datagram_received(self, data, addr):
309-
asyncio.ensure_future(datagram_handler(self.transport, data, addr, **vars(self), **args))
306+
def connection_made(prot, transport):
307+
prot.transport = transport
308+
def datagram_received(prot, data, addr):
309+
asyncio.ensure_future(datagram_handler(prot.transport, data, addr, **vars(self), **args))
310310
return asyncio.get_event_loop().create_datagram_endpoint(Protocol, local_addr=(self.host_name, self.port))
311311
async def open_connection(self, host, port, local_addr, lbind):
312312
if self.reuse:

0 commit comments

Comments
 (0)