This repository was archived by the owner on Oct 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 167
Configurable listening addresses #173
Comments
bors bot
added a commit
that referenced
this issue
Sep 9, 2020
364: Configurable listening addrs r=aphelionz a=ljedrz This PR allows us to specify the desired listening address(es) of the node. For now, these addresses are just additions to the current randomly assigned listening address, as I'm not sure what to pick as the default; once we know this, the only change needed (besides the default listening addresses being put in the config) is to remove the following line from `p2p::create_swarm`: ``` // Listen on all interfaces and whatever port the OS assigns Swarm::listen_on(&mut swarm, "/ip4/127.0.0.1/tcp/0".parse().unwrap()).unwrap(); ``` Another question is how to handle a situation where one/all of the supplied addresses can't be listened on: - refuse to start? - assign a random different address? - only log errors if at least one works? This is currently unresolved, but since the PR preserves the current behavior, this is a concern that needs to be handled in the aforementioned later follow-up. Cc #173. Co-authored-by: ljedrz <ljedrz@gmail.com>
bors bot
added a commit
that referenced
this issue
Sep 9, 2020
364: Configurable listening addrs r=aphelionz a=ljedrz This PR allows us to specify the desired listening address(es) of the node. For now, these addresses are just additions to the current randomly assigned listening address, as I'm not sure what to pick as the default; once we know this, the only change needed (besides the default listening addresses being put in the config) is to remove the following line from `p2p::create_swarm`: ``` // Listen on all interfaces and whatever port the OS assigns Swarm::listen_on(&mut swarm, "/ip4/127.0.0.1/tcp/0".parse().unwrap()).unwrap(); ``` Another question is how to handle a situation where one/all of the supplied addresses can't be listened on: - refuse to start? - assign a random different address? - only log errors if at least one works? This is currently unresolved, but since the PR preserves the current behavior, this is a concern that needs to be handled in the aforementioned later follow-up. Cc #173. Co-authored-by: ljedrz <ljedrz@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently rust-ipfs defaults to listening on a random localhost port like many rust-libp2p examples. In #169 the initial support for adding and removing listening addresses was implemented to realize a test case of a peer having multiple connections but the old behaviour of listening on a random localhost address remained.
rust-ipfs could however take the listening address(es) as a
Multiaddr
inIpfsOptions
. This would allow removal of the random listening address.This option could be populated per config section "Addresses" by the http.
The text was updated successfully, but these errors were encountered: