proxynt 2.0.32__tar.gz → 2.0.38__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.
Files changed (101) hide show
  1. {proxynt-2.0.32 → proxynt-2.0.38}/PKG-INFO +1 -1
  2. {proxynt-2.0.32 → proxynt-2.0.38}/constant/system_constant.py +1 -1
  3. {proxynt-2.0.32 → proxynt-2.0.38}/proxynt.egg-info/PKG-INFO +1 -1
  4. proxynt-2.0.38/proxynt.egg-info/requires.txt +15 -0
  5. {proxynt-2.0.32 → proxynt-2.0.38}/server/websocket_handler.py +15 -6
  6. {proxynt-2.0.32 → proxynt-2.0.38}/setup.py +2 -1
  7. proxynt-2.0.32/proxynt.egg-info/requires.txt +0 -12
  8. {proxynt-2.0.32 → proxynt-2.0.38}/LICENSE +0 -0
  9. {proxynt-2.0.32 → proxynt-2.0.38}/MANIFEST.in +0 -0
  10. {proxynt-2.0.32 → proxynt-2.0.38}/__init__.py +0 -0
  11. {proxynt-2.0.32 → proxynt-2.0.38}/client/__init__.py +0 -0
  12. {proxynt-2.0.32 → proxynt-2.0.38}/client/abstract_tunnel.py +0 -0
  13. {proxynt-2.0.32 → proxynt-2.0.38}/client/clear_nonce_task.py +0 -0
  14. {proxynt-2.0.32 → proxynt-2.0.38}/client/heart_beat_task.py +0 -0
  15. {proxynt-2.0.32 → proxynt-2.0.38}/client/kcp_tunnel_impl.py +0 -0
  16. {proxynt-2.0.32 → proxynt-2.0.38}/client/n4_tunnel_manager.py +0 -0
  17. {proxynt-2.0.32 → proxynt-2.0.38}/client/quic_tunnel_impl.py +0 -0
  18. {proxynt-2.0.32 → proxynt-2.0.38}/client/tcp_forward_client.py +0 -0
  19. {proxynt-2.0.32 → proxynt-2.0.38}/client/tunnel_protocol.py +0 -0
  20. {proxynt-2.0.32 → proxynt-2.0.38}/client/udp_forward_client.py +0 -0
  21. {proxynt-2.0.32 → proxynt-2.0.38}/common/__init__.py +0 -0
  22. {proxynt-2.0.32 → proxynt-2.0.38}/common/cert_utils.py +0 -0
  23. {proxynt-2.0.32 → proxynt-2.0.38}/common/crypto/__init__.py +0 -0
  24. {proxynt-2.0.32 → proxynt-2.0.38}/common/crypto/table.py +0 -0
  25. {proxynt-2.0.32 → proxynt-2.0.38}/common/encrypt_utils.py +0 -0
  26. {proxynt-2.0.32 → proxynt-2.0.38}/common/kcp.py +0 -0
  27. {proxynt-2.0.32 → proxynt-2.0.38}/common/logger_factory.py +0 -0
  28. {proxynt-2.0.32 → proxynt-2.0.38}/common/n4_protocol.py +0 -0
  29. {proxynt-2.0.32 → proxynt-2.0.38}/common/n4_punch.py +0 -0
  30. {proxynt-2.0.32 → proxynt-2.0.38}/common/nat_serialization.py +0 -0
  31. {proxynt-2.0.32 → proxynt-2.0.38}/common/pool.py +0 -0
  32. {proxynt-2.0.32 → proxynt-2.0.38}/common/register_append_data.py +0 -0
  33. {proxynt-2.0.32 → proxynt-2.0.38}/common/speed_limit.py +0 -0
  34. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/__init__.py +0 -0
  35. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_abnf.py +0 -0
  36. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_app.py +0 -0
  37. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_cookiejar.py +0 -0
  38. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_core.py +0 -0
  39. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_exceptions.py +0 -0
  40. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_handshake.py +0 -0
  41. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_http.py +0 -0
  42. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_logging.py +0 -0
  43. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_socket.py +0 -0
  44. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_ssl_compat.py +0 -0
  45. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_url.py +0 -0
  46. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_utils.py +0 -0
  47. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/_wsdump.py +0 -0
  48. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/__init__.py +0 -0
  49. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/echo-server.py +0 -0
  50. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/test_abnf.py +0 -0
  51. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/test_app.py +0 -0
  52. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/test_cookiejar.py +0 -0
  53. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/test_http.py +0 -0
  54. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/test_url.py +0 -0
  55. {proxynt-2.0.32 → proxynt-2.0.38}/common/websocket/tests/test_websocket.py +0 -0
  56. {proxynt-2.0.32 → proxynt-2.0.38}/constant/__init__.py +0 -0
  57. {proxynt-2.0.32 → proxynt-2.0.38}/constant/message_type_constnat.py +0 -0
  58. {proxynt-2.0.32 → proxynt-2.0.38}/context/__init__.py +0 -0
  59. {proxynt-2.0.32 → proxynt-2.0.38}/context/context_utils.py +0 -0
  60. {proxynt-2.0.32 → proxynt-2.0.38}/entity/__init__.py +0 -0
  61. {proxynt-2.0.32 → proxynt-2.0.38}/entity/client_config_entity.py +0 -0
  62. {proxynt-2.0.32 → proxynt-2.0.38}/entity/message/__init__.py +0 -0
  63. {proxynt-2.0.32 → proxynt-2.0.38}/entity/message/message_entity.py +0 -0
  64. {proxynt-2.0.32 → proxynt-2.0.38}/entity/message/push_config_entity.py +0 -0
  65. {proxynt-2.0.32 → proxynt-2.0.38}/entity/message/tcp_over_websocket_message.py +0 -0
  66. {proxynt-2.0.32 → proxynt-2.0.38}/entity/server_config_entity.py +0 -0
  67. {proxynt-2.0.32 → proxynt-2.0.38}/exceptions/__init__.py +0 -0
  68. {proxynt-2.0.32 → proxynt-2.0.38}/exceptions/duplicated_name.py +0 -0
  69. {proxynt-2.0.32 → proxynt-2.0.38}/exceptions/invalid_password.py +0 -0
  70. {proxynt-2.0.32 → proxynt-2.0.38}/exceptions/replay_error.py +0 -0
  71. {proxynt-2.0.32 → proxynt-2.0.38}/exceptions/signature_error.py +0 -0
  72. {proxynt-2.0.32 → proxynt-2.0.38}/p2ptest/__init__.py +0 -0
  73. {proxynt-2.0.32 → proxynt-2.0.38}/p2ptest/client.py +0 -0
  74. {proxynt-2.0.32 → proxynt-2.0.38}/p2ptest/n4.py +0 -0
  75. {proxynt-2.0.32 → proxynt-2.0.38}/proxynt.egg-info/SOURCES.txt +0 -0
  76. {proxynt-2.0.32 → proxynt-2.0.38}/proxynt.egg-info/dependency_links.txt +0 -0
  77. {proxynt-2.0.32 → proxynt-2.0.38}/proxynt.egg-info/entry_points.txt +0 -0
  78. {proxynt-2.0.32 → proxynt-2.0.38}/proxynt.egg-info/top_level.txt +0 -0
  79. {proxynt-2.0.32 → proxynt-2.0.38}/run_client.py +0 -0
  80. {proxynt-2.0.32 → proxynt-2.0.38}/run_server.py +0 -0
  81. {proxynt-2.0.32 → proxynt-2.0.38}/server/__init__.py +0 -0
  82. {proxynt-2.0.32 → proxynt-2.0.38}/server/admin_http_handler.py +0 -0
  83. {proxynt-2.0.32 → proxynt-2.0.38}/server/n4.py +0 -0
  84. {proxynt-2.0.32 → proxynt-2.0.38}/server/n4_signal_service.py +0 -0
  85. {proxynt-2.0.32 → proxynt-2.0.38}/server/task/__init__.py +0 -0
  86. {proxynt-2.0.32 → proxynt-2.0.38}/server/task/check_cookie_task.py +0 -0
  87. {proxynt-2.0.32 → proxynt-2.0.38}/server/task/clear_nonce_task.py +0 -0
  88. {proxynt-2.0.32 → proxynt-2.0.38}/server/task/heart_beat_task.py +0 -0
  89. {proxynt-2.0.32 → proxynt-2.0.38}/server/tcp_forward_client.py +0 -0
  90. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/__init__.py +0 -0
  91. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/base.html +0 -0
  92. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/css/fonts/element-icons.woff +0 -0
  93. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/css/index.css +0 -0
  94. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/ele_index.html +0 -0
  95. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/js/axios.min.js +0 -0
  96. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/js/index.js +0 -0
  97. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/js/vue.min.js +0 -0
  98. {proxynt-2.0.32 → proxynt-2.0.38}/server/template/login.html +0 -0
  99. {proxynt-2.0.32 → proxynt-2.0.38}/server/udp_forward_client.py +0 -0
  100. {proxynt-2.0.32 → proxynt-2.0.38}/setup.cfg +0 -0
  101. {proxynt-2.0.32 → proxynt-2.0.38}/test_exchange.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: proxynt
3
- Version: 2.0.32
3
+ Version: 2.0.38
4
4
  Summary: UNKNOWN
5
5
  Home-page: https://github.com/sazima/proxynt
6
6
  License: UNKNOWN
@@ -15,7 +15,7 @@ class SystemConstant:
15
15
 
16
16
  COOKIE_EXPIRE_SECONDS = 3600 * 24
17
17
 
18
- VERSION = '2.0.32'
18
+ VERSION = '2.0.38'
19
19
 
20
20
  GITHUB = 'https://github.com/sazima/proxynt'
21
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: proxynt
3
- Version: 2.0.32
3
+ Version: 2.0.38
4
4
  Summary: UNKNOWN
5
5
  Home-page: https://github.com/sazima/proxynt
6
6
  License: UNKNOWN
@@ -0,0 +1,15 @@
1
+ tornado
2
+ typing_extensions
3
+ xxhash>=3.0.0
4
+
5
+ [:sys_platform != "win32" and python_version < "3.7"]
6
+ uvloop<0.15
7
+
8
+ [:sys_platform != "win32" and python_version >= "3.7"]
9
+ uvloop==0.22.0
10
+
11
+ [:sys_platform == "win32"]
12
+ winloop>=0.1.0
13
+
14
+ [snappy]
15
+ python-snappy
@@ -54,7 +54,14 @@ class MyWebSocketaHandler(WebSocketHandler):
54
54
  # 客户端到客户端转发路由状态
55
55
  # uid → (source_handler, target_handler, rule_name, protocol, target_ip_port)
56
56
  c2c_uid_to_routing: Dict[bytes, Tuple['MyWebSocketaHandler', 'MyWebSocketaHandler', str, str, str]] = {}
57
- c2c_lock: Lock = Lock()
57
+ _c2c_lock: Lock = None
58
+
59
+ def get_c2c_lock(self):
60
+ if self._c2c_lock is not None:
61
+ return self._c2c_lock
62
+ self._c2c_lock = Lock()
63
+ return self._c2c_lock
64
+
58
65
 
59
66
  def open(self, *args: str, **kwargs: str):
60
67
  self.lock = Lock()
@@ -135,7 +142,7 @@ class MyWebSocketaHandler(WebSocketHandler):
135
142
  if not is_c2c:
136
143
  conn = tcp_forward_client.uid_to_connection.get(uid)
137
144
  if not conn or conn.socket_server.websocket_handler != self:
138
- LoggerFactory.get_logger().warning(f"Security Alert: Client {self.client_name} tried to inject TCP data to UID {uid.hex()} belonging to another client/session.")
145
+ LoggerFactory.get_logger().debug(f"Security Alert: Client {self.client_name} tried to inject TCP data to UID {uid.hex()} belonging to another client/session.")
139
146
  return
140
147
 
141
148
  if is_c2c:
@@ -160,7 +167,7 @@ class MyWebSocketaHandler(WebSocketHandler):
160
167
  )
161
168
 
162
169
  if not data['data']:
163
- async with self.c2c_lock:
170
+ async with self.get_c2c_lock():
164
171
  self.c2c_uid_to_routing.pop(uid, None)
165
172
  LoggerFactory.get_logger().info(f'C2C 连接关闭 UID: {uid.hex()}')
166
173
  else:
@@ -364,7 +371,7 @@ class MyWebSocketaHandler(WebSocketHandler):
364
371
  source_handler.compress_support),
365
372
  binary=True
366
373
  )
367
- async with self.c2c_lock:
374
+ async with self.get_c2c_lock():
368
375
  self.c2c_uid_to_routing.pop(uid, None)
369
376
  LoggerFactory.get_logger().info(f'C2C 连接失败并已清理 UID: {uid.hex()}')
370
377
  elif uid in tcp_forward_client.uid_to_connection:
@@ -386,6 +393,8 @@ class MyWebSocketaHandler(WebSocketHandler):
386
393
  await self._send_connection_failed(uid, source_rule_name)
387
394
  return
388
395
 
396
+ LoggerFactory.get_logger().info(f'C2C rule found: {source_rule_name}, speed_limit: {rule.get("speed_limit", 0.0)} MB/s')
397
+
389
398
  if target_client not in self.client_name_to_handler:
390
399
  LoggerFactory.get_logger().warn(f'Target client offline: {target_client}')
391
400
  await self._send_connection_failed(uid, source_rule_name)
@@ -414,7 +423,7 @@ class MyWebSocketaHandler(WebSocketHandler):
414
423
  ip_port = f"{target_service_config['local_ip']}:{target_service_config['local_port']}"
415
424
  service_name = target_service
416
425
 
417
- async with self.c2c_lock:
426
+ async with self.get_c2c_lock():
418
427
  self.c2c_uid_to_routing[uid] = (self, target_handler, source_rule_name, protocol, ip_port)
419
428
 
420
429
  # Try P2P if both clients support it AND rule allows it (only for TCP)
@@ -528,7 +537,7 @@ class MyWebSocketaHandler(WebSocketHandler):
528
537
  await UdpForwardClient.get_instance().close_by_client_name(self.client_name)
529
538
 
530
539
  # 清理 C2C 连接
531
- async with self.c2c_lock:
540
+ async with self.get_c2c_lock():
532
541
  uids_to_remove = []
533
542
  for uid, (source_handler, target_handler, rule_name, protocol, _) in list(self.c2c_uid_to_routing.items()):
534
543
  if source_handler == self or target_handler == self:
@@ -31,8 +31,9 @@ setuptools.setup(
31
31
 
32
32
  install_requires=['tornado',
33
33
  'typing_extensions',
34
- 'uvloop>=0.14.0; sys_platform != "win32"',
35
34
  'winloop>=0.1.0; sys_platform == "win32"',
35
+ 'uvloop==0.22.0; sys_platform != "win32" and python_version >= "3.7"',
36
+ 'uvloop<0.15; sys_platform != "win32" and python_version < "3.7"',
36
37
  'xxhash>=3.0.0',
37
38
  ],
38
39
  extras_require={
@@ -1,12 +0,0 @@
1
- tornado
2
- typing_extensions
3
- xxhash>=3.0.0
4
-
5
- [:sys_platform != "win32"]
6
- uvloop>=0.14.0
7
-
8
- [:sys_platform == "win32"]
9
- winloop>=0.1.0
10
-
11
- [snappy]
12
- python-snappy
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes