GNServer 0.0.0.0.14__tar.gz → 0.0.0.0.16__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.
@@ -519,11 +519,11 @@ class App:
519
519
 
520
520
 
521
521
 
522
-
523
-
524
-
525
-
526
-
522
+ def _init_sys_routes(self):
523
+ @self.get('/!gn-vm-host/ping')
524
+ async def r_ping(request: gn.GNRequest):
525
+ if request
526
+ return gn.GNResponse('ok', {'status': 'pong'})
527
527
 
528
528
 
529
529
 
@@ -559,7 +559,8 @@ class App:
559
559
  # request.stream_id = event.stream_id
560
560
  # loop = asyncio.get_event_loop()
561
561
  # request.fut = loop.create_future()
562
-
562
+
563
+
563
564
  request.stream_id = event.stream_id
564
565
  asyncio.create_task(self._handle_request(request, mode))
565
566
  logger.debug(f'Отправлена задача разрешения пакета {request} route -> {request.route}')
@@ -620,6 +621,9 @@ class App:
620
621
  asyncio.create_task(self._handle_request(request, mode))
621
622
 
622
623
  async def _handle_request(self, request: gn.GNRequest, mode: int):
624
+
625
+ request._client_ip = self._quic._network_paths[0].addr[0]
626
+
623
627
  try:
624
628
 
625
629
  response = await self._api.dispatch(request)
@@ -670,6 +674,9 @@ class App:
670
674
  idle_timeout: float = 20.0,
671
675
  wait: bool = True
672
676
  ):
677
+
678
+ self._init_sys_routes()
679
+
673
680
  cfg = QuicConfiguration(
674
681
  alpn_protocols=["gn:backend"], is_client=False, idle_timeout=idle_timeout
675
682
  )
@@ -106,6 +106,14 @@ class AsyncClient:
106
106
  self._active_connections: Dict[str, Any] = {}
107
107
 
108
108
  async def _getCoreDNS(self, domain: str):
109
+
110
+ if domain.split('.')[-1].isdigit() and domain.split(':')[-1].isdigit():
111
+ r2_data = {
112
+ "ip": domain.split(':')[0],
113
+ "port": int(domain.split(':')[-1])
114
+ }
115
+ return r2_data
116
+
109
117
  try:
110
118
  if self.__dns_gn__ipv4 is None:
111
119
  r1 = await httpxAsyncClient.request('GET', f'https://{self.__dns_core__ipv4}/gn/getIp?d=dns.gn')
@@ -140,7 +148,6 @@ class AsyncClient:
140
148
  return
141
149
 
142
150
  data = await self._getCoreDNS(domain)
143
-
144
151
  # подключаемся к серверу gn-proxy
145
152
  await self._client.connect(data['ip'], data['port'])
146
153
  self._active_connections[domain] = 'active'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GNServer
3
- Version: 0.0.0.0.14
3
+ Version: 0.0.0.0.16
4
4
  Summary: GNServer
5
5
  Home-page: https://github.com/KeyisB/libs/tree/main/GNServer
6
6
  Author: KeyisB
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GNServer
3
- Version: 0.0.0.0.14
3
+ Version: 0.0.0.0.16
4
4
  Summary: GNServer
5
5
  Home-page: https://github.com/KeyisB/libs/tree/main/GNServer
6
6
  Author: KeyisB
@@ -5,7 +5,7 @@ filesName = 'GNServer'
5
5
 
6
6
  setup(
7
7
  name=name,
8
- version='0.0.0.0.14',
8
+ version='0.0.0.0.16',
9
9
  author="KeyisB",
10
10
  author_email="keyisb.pip@gmail.com",
11
11
  description=name,
File without changes
File without changes
File without changes