meshsocket 0.4.1__tar.gz → 0.4.3__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.4
2
2
  Name: meshsocket
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Lightweight WebSocket mesh networking — broadcast, direct routing, and request/response over a simple JSON wire protocol.
5
5
  Author: Carter Beaudoin
6
6
  License-Expression: MIT
@@ -7,4 +7,4 @@ so existing code keeps running while it migrates to the package name.
7
7
  from socketCore import MeshSocket, LogColors, sanitize_identity, valid_ident, IDENT_RE, NAMESPACED_RE
8
8
 
9
9
  __all__ = ["MeshSocket", "LogColors", "sanitize_identity", "valid_ident", "IDENT_RE", "NAMESPACED_RE"]
10
- __version__ = "0.4.1"
10
+ __version__ = "0.4.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshsocket
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Lightweight WebSocket mesh networking — broadcast, direct routing, and request/response over a simple JSON wire protocol.
5
5
  Author: Carter Beaudoin
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "meshsocket"
7
- version = "0.4.1"
7
+ version = "0.4.3"
8
8
  description = "Lightweight WebSocket mesh networking — broadcast, direct routing, and request/response over a simple JSON wire protocol."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -500,13 +500,18 @@ class MeshServer:
500
500
  if not isinstance(payload, dict):
501
501
  return {"error": "malformed route", "status": "failed"}
502
502
  target_id = payload.get('target_id')
503
+ target_name = payload.get('target_name')
503
504
  msg_type = payload.get('type')
504
505
  # The target learns who sent this from the relay, not the sender.
505
506
  data = stamp_sender(payload.get('payload'), client.name)
506
- if not isinstance(target_id, str) or not isinstance(msg_type, str):
507
+ # Address by id, or by name like route_msg_noreply (the app's hub-audio
508
+ # requests name the hub: CAR-TER aif-6e55l, spec "Wire contract").
509
+ by_id = isinstance(target_id, str)
510
+ address = target_id if by_id else target_name
511
+ if not isinstance(msg_type, str) or not isinstance(address, str):
507
512
  return {"error": "malformed route", "status": "failed"}
508
513
 
509
- target = self.clients.get(target_id)
514
+ target = self.clients.get(address) if by_id else self.clients_by_name.get(address)
510
515
  if not target:
511
516
  return {"error": "Target not found", "status": "failed"}
512
517
  if not client.can_route:
File without changes
File without changes
File without changes
File without changes