cubething_psync 0.1.0.dev4__py3-none-any.whl → 0.1.0.dev6__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.
- client/main.py +0 -1
- {cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/METADATA +1 -1
- {cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/RECORD +8 -8
- server/main.py +8 -9
- {cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/WHEEL +0 -0
- {cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/entry_points.txt +0 -0
- {cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/licenses/LICENSE +0 -0
- {cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/top_level.txt +0 -0
client/main.py
CHANGED
|
@@ -87,7 +87,6 @@ class PsyncClient:
|
|
|
87
87
|
ssl_ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
|
88
88
|
ssl_ctx.load_verify_locations(pathlib.Path(SSL_CERT_PATH).expanduser())
|
|
89
89
|
ssl_ctx.check_hostname = False # not ideal
|
|
90
|
-
print(ssl_ctx.get_ca_certs())
|
|
91
90
|
async with websockets.connect(
|
|
92
91
|
f"wss://{SERVER_IP}:{SERVER_PORT}", ssl=ssl_ctx
|
|
93
92
|
) as ws:
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
client/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
2
2
|
client/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
|
|
3
3
|
client/args.py,sha256=yHREZ9hiWNEt61TJRk-1nnAi5n5RCQC2fJCZeoyzInQ,2182
|
|
4
|
-
client/main.py,sha256=
|
|
4
|
+
client/main.py,sha256=Hi6Qy3SBTFm-zLgkI42H5Z6h6kba7kOPJXHcoxK0-WQ,5517
|
|
5
5
|
common/__init__.py,sha256=ss0hfom-0D_mZFXzp0_PjVTju4_F6eZv-2xa_fKxyOM,48
|
|
6
6
|
common/data.py,sha256=q0xoGE7WAoVpBibXCZFWJeRex4xCYIJnVy8tj4tQ75k,3367
|
|
7
7
|
common/log.py,sha256=csgaJXv55Dkx0lEbbeFHbNPNedQI4m4TvzEcXZqP1ps,777
|
|
8
|
-
cubething_psync-0.1.0.
|
|
8
|
+
cubething_psync-0.1.0.dev6.dist-info/licenses/LICENSE,sha256=I_GOA9xJ35FiL-KnYXZJdATkbO2KcV2dK2enRGVxzKM,1023
|
|
9
9
|
server/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
10
10
|
server/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
|
|
11
|
-
server/main.py,sha256=
|
|
12
|
-
cubething_psync-0.1.0.
|
|
13
|
-
cubething_psync-0.1.0.
|
|
14
|
-
cubething_psync-0.1.0.
|
|
15
|
-
cubething_psync-0.1.0.
|
|
16
|
-
cubething_psync-0.1.0.
|
|
11
|
+
server/main.py,sha256=8-qXpHUvtS_-qhYOfZH1RS9IUOeD1-81za9hHvcl_5s,8881
|
|
12
|
+
cubething_psync-0.1.0.dev6.dist-info/METADATA,sha256=HuS2qzgTge6EIQAvko9S1XXBqUu4HbRBKitcqLeKYGA,1127
|
|
13
|
+
cubething_psync-0.1.0.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
cubething_psync-0.1.0.dev6.dist-info/entry_points.txt,sha256=Mt-3F-F6JxQo4c40wiDT8Lj0t4U4LI2ZC_lD-uo1szE,82
|
|
15
|
+
cubething_psync-0.1.0.dev6.dist-info/top_level.txt,sha256=FC-5h-e7XOGsRL8m12y95vvnsK4XIN_GxdDJDBf31HM,21
|
|
16
|
+
cubething_psync-0.1.0.dev6.dist-info/RECORD,,
|
server/main.py
CHANGED
|
@@ -34,12 +34,6 @@ import logging
|
|
|
34
34
|
from common.log import InterceptHandler
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
def __get_host(ws: ServerConnection) -> str:
|
|
38
|
-
addrs: tuple[str, str] = ws.remote_address # pyright: ignore[reportAny]
|
|
39
|
-
(host, _port) = addrs
|
|
40
|
-
return host
|
|
41
|
-
|
|
42
|
-
|
|
43
37
|
SSL_CERT_PATH: str = environ.get("SSL_CERT_PATH", "./cert.pem")
|
|
44
38
|
SSL_KEY_PATH: str = environ.get("SSL_KEY_PATH", "./key.pem")
|
|
45
39
|
PSYNC_HOST: str = environ.get("PSYNC_SERVER_IP", "0.0.0.0")
|
|
@@ -88,6 +82,11 @@ class PsyncServer:
|
|
|
88
82
|
__coroutine: Task[None] | None = None
|
|
89
83
|
"""The main coroutine for this server."""
|
|
90
84
|
|
|
85
|
+
def __get_host(self, ws: ServerConnection) -> str:
|
|
86
|
+
addrs: tuple[str, str] = ws.remote_address # pyright: ignore[reportAny]
|
|
87
|
+
(host, _port) = addrs
|
|
88
|
+
return host
|
|
89
|
+
|
|
91
90
|
async def serve(self) -> None:
|
|
92
91
|
"""
|
|
93
92
|
The main interface for the server. Will serve forever, or until exited with SIGINT/Ctrl-C.
|
|
@@ -124,7 +123,7 @@ class PsyncServer:
|
|
|
124
123
|
return inner
|
|
125
124
|
|
|
126
125
|
async def __end_session(self, ws: ServerConnection):
|
|
127
|
-
host = __get_host(ws)
|
|
126
|
+
host = self.__get_host(ws)
|
|
128
127
|
try:
|
|
129
128
|
_ = self.__sessions.pop(host)
|
|
130
129
|
except Exception:
|
|
@@ -179,7 +178,7 @@ class PsyncServer:
|
|
|
179
178
|
return inner
|
|
180
179
|
|
|
181
180
|
async def __open(self, req: OpenReq, ws: ServerConnection):
|
|
182
|
-
host = __get_host(ws)
|
|
181
|
+
host = self.__get_host(ws)
|
|
183
182
|
if self.__sessions.get(host) is not None:
|
|
184
183
|
self.__sessions[host]
|
|
185
184
|
resp = ErrorResp(msg="Process already open for this client.")
|
|
@@ -228,7 +227,7 @@ class PsyncServer:
|
|
|
228
227
|
pass
|
|
229
228
|
|
|
230
229
|
async def __kill(self, _req: KillReq, ws: ServerConnection):
|
|
231
|
-
host = __get_host(ws)
|
|
230
|
+
host = self.__get_host(ws)
|
|
232
231
|
p = self.__sessions.get(host)
|
|
233
232
|
task = self.__tasks.get(host)
|
|
234
233
|
if p is not None and task is not None:
|
|
File without changes
|
{cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{cubething_psync-0.1.0.dev4.dist-info → cubething_psync-0.1.0.dev6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|