wisp-python 0.5.0__tar.gz → 0.5.1__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.
@@ -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
@@ -11,7 +11,7 @@ package-dir = {"" = "src"}
11
11
 
12
12
  [project]
13
13
  name = "wisp-python"
14
- version = "0.5.0"
14
+ version = "0.5.1"
15
15
  authors = [
16
16
  {name="ading2210"},
17
17
  ]
@@ -0,0 +1,4 @@
1
+ from wisp import server
2
+ from wisp import util
3
+
4
+ version = util.get_version()
@@ -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("/"):
@@ -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
@@ -2,6 +2,7 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  src/wisp/__init__.py
5
+ src/wisp/util.py
5
6
  src/wisp/server/__init__.py
6
7
  src/wisp/server/__main__.py
7
8
  src/wisp/server/connection.py
@@ -1,2 +0,0 @@
1
- from wisp import server
2
- version = "0.5.0"
File without changes
File without changes
File without changes