GNServer 0.0.0.0.14__py3-none-any.whl → 0.0.0.0.16__py3-none-any.whl
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.
- GNServer/_app.py +13 -6
- GNServer/_client.py +8 -1
- {gnserver-0.0.0.0.14.dist-info → gnserver-0.0.0.0.16.dist-info}/METADATA +1 -1
- gnserver-0.0.0.0.16.dist-info/RECORD +8 -0
- gnserver-0.0.0.0.14.dist-info/RECORD +0 -8
- {gnserver-0.0.0.0.14.dist-info → gnserver-0.0.0.0.16.dist-info}/WHEEL +0 -0
- {gnserver-0.0.0.0.14.dist-info → gnserver-0.0.0.0.16.dist-info}/licenses/LICENSE +0 -0
- {gnserver-0.0.0.0.14.dist-info → gnserver-0.0.0.0.16.dist-info}/top_level.txt +0 -0
GNServer/_app.py
CHANGED
@@ -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
|
)
|
GNServer/_client.py
CHANGED
@@ -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'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
GNServer/__init__.py,sha256=J4bjDqXVSEgOhD-FmkhpCeU4NJkp2BKMUKgltiuSXVo,1437
|
2
|
+
GNServer/_app.py,sha256=ZXJTTFCMhKWWVrauhvKjrwztvUhg6k_93ujU_m8CQRE,24592
|
3
|
+
GNServer/_client.py,sha256=tSpFkUuwHRPqmIjdTdcYWzPwDUTDaDRNhQOBTlL4jpg,24725
|
4
|
+
gnserver-0.0.0.0.16.dist-info/licenses/LICENSE,sha256=WH_t7dKZyWJ5Ld07eYIkUG4Tv6zZWXtAdsUqYAUesn0,1084
|
5
|
+
gnserver-0.0.0.0.16.dist-info/METADATA,sha256=2_RVRAUtZAacts8XPJWZ8pniCSHMBJznmcZijtNaDwI,805
|
6
|
+
gnserver-0.0.0.0.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
gnserver-0.0.0.0.16.dist-info/top_level.txt,sha256=-UOUBuD4u7Qkb1o5PdcwyA3kx8xCH2lwy0tJHi26Wb4,9
|
8
|
+
gnserver-0.0.0.0.16.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
GNServer/__init__.py,sha256=J4bjDqXVSEgOhD-FmkhpCeU4NJkp2BKMUKgltiuSXVo,1437
|
2
|
-
GNServer/_app.py,sha256=KlsB4dzCwGEgGUX_I-vHE9w1xzjCxj1p_YN5gBeI9ms,24300
|
3
|
-
GNServer/_client.py,sha256=P6RtHr4Ktap5FvpDeftrBG8V2fys3Ac1zIBbphsbOgA,24477
|
4
|
-
gnserver-0.0.0.0.14.dist-info/licenses/LICENSE,sha256=WH_t7dKZyWJ5Ld07eYIkUG4Tv6zZWXtAdsUqYAUesn0,1084
|
5
|
-
gnserver-0.0.0.0.14.dist-info/METADATA,sha256=oUAb9-MotUwASLmV51rlnZYpZwACyhlNXGlQoMWWcww,805
|
6
|
-
gnserver-0.0.0.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
-
gnserver-0.0.0.0.14.dist-info/top_level.txt,sha256=-UOUBuD4u7Qkb1o5PdcwyA3kx8xCH2lwy0tJHi26Wb4,9
|
8
|
-
gnserver-0.0.0.0.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|