simple-proxy 0.0.5__tar.gz → 0.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simple-proxy-0.0.5/simple_proxy.egg-info → simple-proxy-0.0.7}/PKG-INFO +1 -1
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/setup.py +1 -1
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/simple_proxy/__init__.py +12 -8
- simple-proxy-0.0.7/simple_proxy/version.py +1 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7/simple_proxy.egg-info}/PKG-INFO +1 -1
- simple-proxy-0.0.7/simple_proxy.egg-info/requires.txt +4 -0
- simple-proxy-0.0.5/simple_proxy/version.py +0 -1
- simple-proxy-0.0.5/simple_proxy.egg-info/requires.txt +0 -3
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/LICENSE +0 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/README.md +0 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/setup.cfg +0 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/simple_proxy/utils.py +0 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/simple_proxy.egg-info/SOURCES.txt +0 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/simple_proxy.egg-info/dependency_links.txt +0 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/simple_proxy.egg-info/entry_points.txt +0 -0
- {simple-proxy-0.0.5 → simple-proxy-0.0.7}/simple_proxy.egg-info/top_level.txt +0 -0
|
@@ -22,7 +22,7 @@ config = {
|
|
|
22
22
|
'keywords': ['network', 'tcp', 'non-blocking', 'proxy'],
|
|
23
23
|
'version': __version__,
|
|
24
24
|
'packages': find_packages(),
|
|
25
|
-
'install_requires': ['click', 'py-netty', 'cryptography'],
|
|
25
|
+
'install_requires': ['click', 'py-netty', 'cryptography~=42.0.0', 'attrs~=22.1.0'],
|
|
26
26
|
'python_requires': ">=3.7, <4",
|
|
27
27
|
'setup_requires': ['wheel'],
|
|
28
28
|
'package_data': {'simple_proxy': ['*']},
|
|
@@ -4,6 +4,7 @@ import ssl
|
|
|
4
4
|
from functools import wraps
|
|
5
5
|
from py_netty.handler import LoggingChannelHandler
|
|
6
6
|
from py_netty import Bootstrap, ServerBootstrap, EventLoopGroup
|
|
7
|
+
from py_netty.channel import NioSocketChannel
|
|
7
8
|
import traceback
|
|
8
9
|
import sys
|
|
9
10
|
import os
|
|
@@ -188,12 +189,15 @@ def sneaky():
|
|
|
188
189
|
|
|
189
190
|
|
|
190
191
|
@sneaky()
|
|
191
|
-
def _handle(buffer, direction, src, dst, print_content, to_file):
|
|
192
|
-
try:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
except OSError:
|
|
196
|
-
|
|
192
|
+
def _handle(buffer: bytes, direction: bool, src: NioSocketChannel, dst: NioSocketChannel, print_content: bool, to_file: bool):
|
|
193
|
+
# try:
|
|
194
|
+
# src_ip, src_port = src.getpeername()[:2]
|
|
195
|
+
# dst_ip, dst_port = dst.getpeername()[:2]
|
|
196
|
+
# except OSError:
|
|
197
|
+
# return buffer
|
|
198
|
+
|
|
199
|
+
src_ip, src_port = src.channelinfo().peername
|
|
200
|
+
dst_ip, dst_port = dst.channelinfo().peername
|
|
197
201
|
|
|
198
202
|
raddr = (src_ip, src_port) if direction else (dst_ip, dst_port)
|
|
199
203
|
|
|
@@ -297,7 +301,7 @@ class ProxyChannelHandler(LoggingChannelHandler):
|
|
|
297
301
|
class _ChannelHandler(LoggingChannelHandler):
|
|
298
302
|
|
|
299
303
|
def channel_read(this, ctx, bytebuf):
|
|
300
|
-
_handle(bytebuf, False, ctx.channel()
|
|
304
|
+
_handle(bytebuf, False, ctx.channel(), ctx0.channel(), self._content, self._to_file)
|
|
301
305
|
ctx0.write(bytebuf)
|
|
302
306
|
|
|
303
307
|
def channel_inactive(this, ctx):
|
|
@@ -339,7 +343,7 @@ class ProxyChannelHandler(LoggingChannelHandler):
|
|
|
339
343
|
self._client_channel(ctx, self._remote_host, self._remote_port)
|
|
340
344
|
_clients[self.raddr].proxy_socket = self._client.socket()
|
|
341
345
|
|
|
342
|
-
_handle(bytebuf, True, ctx.channel()
|
|
346
|
+
_handle(bytebuf, True, ctx.channel(), self._client, self._content, self._to_file)
|
|
343
347
|
self._client.write(bytebuf)
|
|
344
348
|
|
|
345
349
|
def channel_inactive(self, ctx):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.7"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|