diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-10 00:12:40 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-10 00:12:40 +0200 |
| commit | 618d5b8515550a1b2d89e1cd045f7fba271f9374 (patch) | |
| tree | bf5c60870bf33ba1df7d12141c6800811146d046 /packages/meshbay-node/src/meshbay_node | |
| parent | 217b61ff34390fd24d0a2ad338f6094183debbe3 (diff) | |
| download | meshbay-618d5b8515550a1b2d89e1cd045f7fba271f9374.tar.gz | |
fix(node): QuicChunkClient local_port + QuicChunkServer dual-stack
local_port=0 param on QuicChunkClient — specify for Port-Restricted Cone NAT
hole punching (client must send from the same port the node probed to).
QuicChunkServer default host '::' for IPv4+IPv6 dual-stack on Linux.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/transport/quic_client.py | 17 | ||||
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/transport/quic_server.py | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/transport/quic_client.py b/packages/meshbay-node/src/meshbay_node/transport/quic_client.py index 6041fef..a2220ff 100644 --- a/packages/meshbay-node/src/meshbay_node/transport/quic_client.py +++ b/packages/meshbay-node/src/meshbay_node/transport/quic_client.py @@ -100,16 +100,18 @@ class QuicChunkClient: jwt_token: str, gek: bytes, pk_node_b64: str, + local_port: int = 0, # 0 = OS choisit; spécifier pour hole punching Port-Restricted ): - self._host = host - self._port = port - self._jwt_token = jwt_token - self._gek = gek - self._pk_node = Ed25519PublicKey.from_public_bytes( + self._host = host + self._port = port + self._jwt_token = jwt_token + self._gek = gek + self._local_port = local_port + self._pk_node = Ed25519PublicKey.from_public_bytes( base64.b64decode(pk_node_b64)) self._proto: _MNPClientProtocol | None = None - self._cm = None - self._ctrl_stream = 0 # stream 0 = control/handshake + self._cm = None + self._ctrl_stream = 0 async def __aenter__(self): await self.connect() @@ -129,6 +131,7 @@ class QuicChunkClient: self._host, self._port, configuration=config, create_protocol=_MNPClientProtocol, + local_port=self._local_port, # 0 = aléatoire; local_port=X pour hole punching ) self._proto = await self._cm.__aenter__() diff --git a/packages/meshbay-node/src/meshbay_node/transport/quic_server.py b/packages/meshbay-node/src/meshbay_node/transport/quic_server.py index 2d23da2..8ab359d 100644 --- a/packages/meshbay-node/src/meshbay_node/transport/quic_server.py +++ b/packages/meshbay-node/src/meshbay_node/transport/quic_server.py @@ -228,7 +228,7 @@ class QuicChunkServer: gek: bytes, shared_root: Path, index: GroupIndex, - host: str = "0.0.0.0", + host: str = "::", # écoute IPv4 + IPv6 (dual-stack Linux) port: int = 19000, cert_path: Path | None = None, key_path: Path | None = None, |