From 355c85940b387c292cc65e2a291b6990d4ac6234 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 29 Oct 2026 04:32:42 +0100 Subject: libp2p: add UPnP support --- src/config/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/config') diff --git a/src/config/mod.rs b/src/config/mod.rs index cfe2e7e..cb4bf19 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -291,6 +291,13 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ Some("false"), "With the libp2p transport: find nodes on the LAN (multicast DNS, IPv4). Those that speak continuum are seeds while joining, so nodes on one LAN find each other without configured seeds; a swarm key keeps a new node from joining another swarm on the same LAN.", ), + option( + "libp2p-upnp", + Kind::Flag, + "BOOL", + Some("false"), + "With the libp2p transport: ask the router to forward this node's listen ports (UPnP), and publish where (the router's public address), so that nodes elsewhere can dial it: behind a home router, no relay or hole punching is needed then. Opens those ports on the router for as long as the node runs.", + ), option( "libp2p-public", Kind::Flag, @@ -458,6 +465,9 @@ pub(crate) struct Settings { pub(crate) libp2p_mdns: bool, #[serde(default)] #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] + pub(crate) libp2p_upnp: bool, + #[serde(default)] + #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] pub(crate) libp2p_public: bool, #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] pub(crate) libp2p_key_file: Option, -- cgit v1.3.1