From 4ba727b768a029ba19f3e15c4635acbe8fb7b71d Mon Sep 17 00:00:00 2001 From: cheatfate Date: Mon, 17 Dec 2018 22:39:25 +0200 Subject: [PATCH] Add NAT-PMP support. --- libp2p/daemon/daemonapi.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libp2p/daemon/daemonapi.nim b/libp2p/daemon/daemonapi.nim index ec3de5190..1910865ae 100644 --- a/libp2p/daemon/daemonapi.nim +++ b/libp2p/daemon/daemonapi.nim @@ -92,7 +92,8 @@ type PSFloodSub, ## Enable `FloodSub` protocol in daemon PSGossipSub, ## Enable `GossipSub` protocol in daemon PSNoSign, ## Disable pubsub message signing (default true) - PSStrictSign ## Force strict checking pubsub message signature + PSStrictSign, ## Force strict checking pubsub message signature + NATPortMap ## Force daemon to use NAT-PMP. P2PStream* = ref object flags*: set[P2PStreamFlags] @@ -593,6 +594,8 @@ proc newDaemonApi*(flags: set[P2PDaemonFlags] = {}, args.add("-pubsubSign=false") if PSStrictSign in api.flags: args.add("-pubsubSignStrict=true") + if NATPortMap in api.flags: + args.add("-natPortMap=true") if len(bootstrapNodes) > 0: args.add("-bootstrapPeers=" & bootstrapNodes.join(",")) if len(id) != 0: