aboutsummaryrefslogtreecommitdiffstats
path: root/core/portmanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/portmanager.lua')
-rw-r--r--core/portmanager.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/portmanager.lua b/core/portmanager.lua
index b02ba53b..9684e9db 100644
--- a/core/portmanager.lua
+++ b/core/portmanager.lua
@@ -1,6 +1,7 @@
local config = require "core.configmanager";
local certmanager = require "core.certmanager";
local server = require "net.server";
+local socket = require "socket";
local log = require "util.logger".init("portmanager");
local multitable = require "util.multitable";
@@ -17,9 +18,13 @@ module "portmanager";
--- Config
-local default_interfaces = { "*" };
-local default_local_interfaces = { "127.0.0.1" };
-if config.get("*", "use_ipv6") then
+local default_interfaces = { };
+local default_local_interfaces = { };
+if config.get("*", "use_ipv4") ~= false then
+ table.insert(default_interfaces, "*");
+ table.insert(default_local_interfaces, "127.0.0.1");
+end
+if socket.tcp6 and config.get("*", "use_ipv6") ~= false then
table.insert(default_interfaces, "::");
table.insert(default_local_interfaces, "::1");
end