wisp-python 0.5.0__py3-none-any.whl → 0.5.1__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.
wisp/__init__.py CHANGED
@@ -1,2 +1,4 @@
1
1
  from wisp import server
2
- version = "0.5.0"
2
+ from wisp import util
3
+
4
+ version = util.get_version()
wisp/server/http.py CHANGED
@@ -15,9 +15,10 @@ async def connection_handler(websocket, path):
15
15
  client_ip = websocket.remote_address[0]
16
16
  if client_ip == "127.0.0.1" and "X-Real-IP" in websocket.request_headers:
17
17
  client_ip = websocket.request_headers["X-Real-IP"]
18
+ origin = websocket.request_headers.get("Origin")
18
19
 
19
20
  conn_id = "".join(random.choices("1234567890abcdef", k=8))
20
- logging.info(f"({conn_id}) incoming connection on {path} from {client_ip}")
21
+ logging.info(f"({conn_id}) incoming connection on {path} from {client_ip} (origin: {origin})")
21
22
  ratelimit.inc_client_attr(client_ip, "streams")
22
23
 
23
24
  if path.endswith("/"):
wisp/util.py ADDED
@@ -0,0 +1,7 @@
1
+ import importlib.metadata
2
+
3
+ def get_version():
4
+ try:
5
+ return importlib.metadata.version("wisp-python")
6
+ except TypeError:
7
+ return "0.0.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wisp-python
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: An implementation of a Wisp proxy server in Python
5
5
  Author: ading2210
6
6
  Project-URL: Homepage, https://github.com/MercuryWorkshop/wisp-server-python
@@ -0,0 +1,13 @@
1
+ wisp/__init__.py,sha256=02Fv0s_jJG8U4y5B6AzKPIOzxAuqJyY_So8Guz5bdTk,75
2
+ wisp/util.py,sha256=AU7si8VwJqS8Dwc1PT2pu_f_9Y32GQxivRYwJ3-U0YQ,144
3
+ wisp/server/__init__.py,sha256=LmgQ1nTlnqcTPqRJVc1NGapV9qVR-BK8iPVUMSJ74Qs,102
4
+ wisp/server/__main__.py,sha256=hutqil1sVATK8dlZaL8-VxVpChpQ110wnioVvRrCA-U,1761
5
+ wisp/server/connection.py,sha256=Eon78eD1FDki_jQX46EK9CVtXKzOWJJEWvfykbRCAb4,7672
6
+ wisp/server/http.py,sha256=6i2r97H9DGc2ijLLsCUxXkByaGON6fdqqXCElU_eJNQ,3137
7
+ wisp/server/net.py,sha256=3EL5FzM9BAF2VW6ysTFX1vyJG4xMvrcu_YMlxTYqhI8,2265
8
+ wisp/server/ratelimit.py,sha256=zT_ya_3_ZocSxU0IOVWJ68L4-JSwKsBfqdwp_IvUWhQ,1585
9
+ wisp_python-0.5.1.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
10
+ wisp_python-0.5.1.dist-info/METADATA,sha256=rs00JjeZGjdJ13z-MWckSw6MI67RTiG9gR2CLX2Jw-I,3311
11
+ wisp_python-0.5.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
12
+ wisp_python-0.5.1.dist-info/top_level.txt,sha256=sv0LDAu8cHUc3_VTsCKfXU-6B9HdV4dW22ubeW8KPVs,5
13
+ wisp_python-0.5.1.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- wisp/__init__.py,sha256=Km7k6LrloRefOk7FbxsNO0Th8AMM3rAM1BkN4z0xmLk,41
2
- wisp/server/__init__.py,sha256=LmgQ1nTlnqcTPqRJVc1NGapV9qVR-BK8iPVUMSJ74Qs,102
3
- wisp/server/__main__.py,sha256=hutqil1sVATK8dlZaL8-VxVpChpQ110wnioVvRrCA-U,1761
4
- wisp/server/connection.py,sha256=Eon78eD1FDki_jQX46EK9CVtXKzOWJJEWvfykbRCAb4,7672
5
- wisp/server/http.py,sha256=Hr4nlehFSSPPAmjDea6RxFb0TiPsX0FreAeiG9QgqsY,3067
6
- wisp/server/net.py,sha256=3EL5FzM9BAF2VW6ysTFX1vyJG4xMvrcu_YMlxTYqhI8,2265
7
- wisp/server/ratelimit.py,sha256=zT_ya_3_ZocSxU0IOVWJ68L4-JSwKsBfqdwp_IvUWhQ,1585
8
- wisp_python-0.5.0.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
9
- wisp_python-0.5.0.dist-info/METADATA,sha256=z-BXMKRszoz7sQYPI8z100TqKSZbsqdkkKZ3jjk798Q,3311
10
- wisp_python-0.5.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
11
- wisp_python-0.5.0.dist-info/top_level.txt,sha256=sv0LDAu8cHUc3_VTsCKfXU-6B9HdV4dW22ubeW8KPVs,5
12
- wisp_python-0.5.0.dist-info/RECORD,,