open HTTP port iff HTTP server not listening on localhost

This commit is contained in:
Dan Laine 2020-06-22 13:06:18 -04:00
parent 38f7e23647
commit c7356a581d
1 changed files with 4 additions and 2 deletions

View File

@ -71,8 +71,10 @@ func main() {
mapper := nat.NewDefaultMapper(log, Config.Nat, nat.TCP, "gecko")
defer mapper.UnmapAllPorts()
mapper.MapPort(Config.StakingIP.Port, Config.StakingIP.Port)
mapper.MapPort(Config.HTTPPort, Config.HTTPPort)
mapper.MapPort(Config.StakingIP.Port, Config.StakingIP.Port) // Open staking port
if Config.HTTPHost != "127.0.0.1" && Config.HTTPHost != "localhost" { // Open HTTP port iff HTTP server not listening on localhost
mapper.MapPort(Config.HTTPPort, Config.HTTPPort)
}
node := node.Node{}