mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Merge remote-tracking branch 'acul71/feat/804-add-thin-waist-address' into feat/804-add-thin-waist-address
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user