GNServer 0.0.0.0.15__tar.gz → 0.0.0.0.17__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,12 @@ 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.client_ip != '127.0.0.1':
526
+ return gn.GNResponse('gn:backend:403', {'error': 'Forbidden'})
527
+ return gn.GNResponse('ok', {'time': datetime.datetime.now(datetime.UTC).isoformat()})
527
528
 
528
529
 
529
530
 
@@ -559,7 +560,8 @@ class App:
559
560
  # request.stream_id = event.stream_id
560
561
  # loop = asyncio.get_event_loop()
561
562
  # request.fut = loop.create_future()
562
-
563
+
564
+
563
565
  request.stream_id = event.stream_id
564
566
  asyncio.create_task(self._handle_request(request, mode))
565
567
  logger.debug(f'Отправлена задача разрешения пакета {request} route -> {request.route}')
@@ -620,6 +622,9 @@ class App:
620
622
  asyncio.create_task(self._handle_request(request, mode))
621
623
 
622
624
  async def _handle_request(self, request: gn.GNRequest, mode: int):
625
+
626
+ request._client_ip = self._quic._network_paths[0].addr[0]
627
+
623
628
  try:
624
629
 
625
630
  response = await self._api.dispatch(request)
@@ -670,6 +675,9 @@ class App:
670
675
  idle_timeout: float = 20.0,
671
676
  wait: bool = True
672
677
  ):
678
+
679
+ self._init_sys_routes()
680
+
673
681
  cfg = QuicConfiguration(
674
682
  alpn_protocols=["gn:backend"], is_client=False, idle_timeout=idle_timeout
675
683
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GNServer
3
- Version: 0.0.0.0.15
3
+ Version: 0.0.0.0.17
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.15
3
+ Version: 0.0.0.0.17
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.15',
8
+ version='0.0.0.0.17',
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