Merge remote-tracking branch 'acul71/feat/804-add-thin-waist-address' into feat/804-add-thin-waist-address

This commit is contained in:
yashksaini-coder
2025-08-19 19:56:20 +05:30
7 changed files with 311 additions and 82 deletions

View File

@ -18,10 +18,8 @@ from libp2p.network.stream.net_stream import (
from libp2p.peer.peerinfo import (
info_from_p2p_addr,
)
from libp2p.utils.address_validation import (
get_optimal_binding_address,
get_available_interfaces,
)
PROTOCOL_ID = TProtocol("/echo/1.0.0")
@ -36,8 +34,8 @@ async def _echo_stream_handler(stream: INetStream) -> None:
async def run(port: int, destination: str, seed: int | None = None) -> None:
# Use all available interfaces for listening (JS parity)
listen_addrs = get_available_interfaces(port)
# CHANGED: previously hardcoded 0.0.0.0
listen_addr = get_optimal_binding_address(port)
if seed:
import random