wslink 2.0.2__py3-none-any.whl → 2.0.4__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.
- wslink/__init__.py +1 -0
- wslink/backends/aiohttp/__init__.py +13 -1
- wslink/chunking.py +2 -1
- wslink/server.py +1 -0
- {wslink-2.0.2.dist-info → wslink-2.0.4.dist-info}/METADATA +1 -1
- {wslink-2.0.2.dist-info → wslink-2.0.4.dist-info}/RECORD +8 -8
- {wslink-2.0.2.dist-info → wslink-2.0.4.dist-info}/WHEEL +0 -0
- {wslink-2.0.2.dist-info → wslink-2.0.4.dist-info}/top_level.txt +0 -0
wslink/__init__.py
CHANGED
@@ -35,12 +35,24 @@ def _fix_path(path):
|
|
35
35
|
|
36
36
|
|
37
37
|
# -----------------------------------------------------------------------------
|
38
|
+
# Needed for WASM/sharedArrayBuffer
|
39
|
+
# => we should find a way to dynamically provided needed header
|
40
|
+
# -----------------------------------------------------------------------------
|
41
|
+
@aiohttp_web.middleware
|
42
|
+
async def shared_array_buffer_headers(request: aiohttp_web.Request, handler):
|
43
|
+
response: aiohttp_web.Response = await handler(request)
|
44
|
+
response.headers.setdefault("Cross-Origin-Opener-Policy", "same-origin")
|
45
|
+
response.headers.setdefault("Cross-Origin-Embedder-Policy", "require-corp")
|
46
|
+
response.headers.setdefault("Access-Control-Allow-Origin", "*")
|
47
|
+
response.headers.setdefault("Cache-Control", "no-store")
|
48
|
+
return response
|
38
49
|
|
39
50
|
|
51
|
+
# -----------------------------------------------------------------------------
|
40
52
|
class WebAppServer(AbstractWebApp):
|
41
53
|
def __init__(self, server_config):
|
42
54
|
AbstractWebApp.__init__(self, server_config)
|
43
|
-
self.set_app(aiohttp_web.Application())
|
55
|
+
self.set_app(aiohttp_web.Application(middlewares=[shared_array_buffer_headers]))
|
44
56
|
self._ws_handlers = []
|
45
57
|
self._site = None
|
46
58
|
self._runner = None
|
wslink/chunking.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import os
|
1
2
|
import sys
|
2
3
|
import secrets
|
3
4
|
import msgpack
|
@@ -87,7 +88,7 @@ class UnChunker:
|
|
87
88
|
|
88
89
|
def __init__(self):
|
89
90
|
self.pending_messages = {}
|
90
|
-
self.max_message_size = 512
|
91
|
+
self.max_message_size = int(os.environ.get("WSLINK_AUTH_MSG_SIZE", 512))
|
91
92
|
|
92
93
|
def set_max_message_size(self, size):
|
93
94
|
self.max_message_size = size
|
wslink/server.py
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
wslink/LICENSE,sha256=I44UH7kDVqxDLnnlOWw_hFL2Fz7RjQ_4vPzZv9NYgTU,1483
|
2
|
-
wslink/__init__.py,sha256=
|
3
|
-
wslink/chunking.py,sha256=
|
2
|
+
wslink/__init__.py,sha256=7Uyn6lk5LhykHbBwQ9pwSmX1YhxDanD9TT6H95DXzhk,2709
|
3
|
+
wslink/chunking.py,sha256=1DJlGG6fjknGFrqPOtqUUc5tCrijldP7Kdx56d5e3Wg,7337
|
4
4
|
wslink/launcher.py,sha256=8VMs3juObLkyGYQFNLjMoo4qFpKIcxWz0kS-af-DKO4,21170
|
5
5
|
wslink/protocol.py,sha256=zdf4QthFHpAgEw3hTUyyaOuN76jzHeOJBpvekPbk7aY,15886
|
6
6
|
wslink/publish.py,sha256=9G5TXqyGr-LCo_LwHYhzif6lhG2iXDvEBmEgwR8fh1M,1437
|
7
7
|
wslink/relay.py,sha256=E8Lzu2Ay7KbOheN1-ArAZawo8lLqdDgJXOZSBuMknYs,86
|
8
|
-
wslink/server.py,sha256=
|
8
|
+
wslink/server.py,sha256=yvhCjpzPOfhbZrpDvW9i4H_uSyuQAe3ZOP-BRBmgHQA,9326
|
9
9
|
wslink/ssl_context.py,sha256=hNOJJCdrStws1Qf6vPvY4vTk9Bf8J5d90W3fS0cRv8o,2290
|
10
10
|
wslink/uri.py,sha256=woCQ4yChUqTMg9IT6YYDtUYeKmCg7OUCEgeBGA-19DY,384
|
11
11
|
wslink/websocket.py,sha256=pBiWqkL8Zn8LuSJ9nv3yA-KjEynbolOQ2gLHtQFJ2Ic,4611
|
12
12
|
wslink/backends/__init__.py,sha256=cyJGjm-YyBSyOEX81owyTbJ3YnrA6dB7--B4LnsEtHI,1214
|
13
|
-
wslink/backends/aiohttp/__init__.py,sha256=
|
13
|
+
wslink/backends/aiohttp/__init__.py,sha256=sXCL6kI1Ilv_t2V3o6c8fKDcIJ0A3WaB2mwyPrXSM7E,9232
|
14
14
|
wslink/backends/aiohttp/launcher.py,sha256=gHNMvtgNHEwBN_QBRDSCrTp2B4K1PsfV81rKaHi7Cxo,8897
|
15
15
|
wslink/backends/aiohttp/relay.py,sha256=oZAzIQTpsQaObWXaa-_VtoTOUQALC_QLDd9UvWspYaU,13311
|
16
16
|
wslink/backends/generic/__init__.py,sha256=Qu65gWsd2xCSsxybnDtEDI5vMjHN-F5jgPZOyNIxnGs,112
|
@@ -19,7 +19,7 @@ wslink/backends/jupyter/__init__.py,sha256=Qu65gWsd2xCSsxybnDtEDI5vMjHN-F5jgPZOy
|
|
19
19
|
wslink/backends/jupyter/core.py,sha256=PCQN-uZPFROnRv8B5dNwnwHV67o4Bpme3_Z6V-zbOUA,3864
|
20
20
|
wslink/backends/tornado/__init__.py,sha256=Qu65gWsd2xCSsxybnDtEDI5vMjHN-F5jgPZOyNIxnGs,112
|
21
21
|
wslink/backends/tornado/core.py,sha256=tPMkkhWuO_ovkisVim0zcegwZKEAG4IRUdd_O_0a_R0,2157
|
22
|
-
wslink-2.0.
|
23
|
-
wslink-2.0.
|
24
|
-
wslink-2.0.
|
25
|
-
wslink-2.0.
|
22
|
+
wslink-2.0.4.dist-info/METADATA,sha256=fTgpqrNfE65VXr09MwvMEd_McVQ1FmHWl5YCYK2iPEM,3045
|
23
|
+
wslink-2.0.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
24
|
+
wslink-2.0.4.dist-info/top_level.txt,sha256=N0d8eqvhwhfW1p1yPTmvxlbzhjz7ZyhBfysNvaFqpQY,7
|
25
|
+
wslink-2.0.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|