Software /
code /
prosody
Comparison
core/portmanager.lua @ 5391:0d49a4e9963b
portmanager: use_ipv6 defaults to true if luasocket has ipv6 support
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 27 Mar 2013 23:32:34 +0100 |
parent | 5319:d20861bf900b |
child | 5392:613959dbd0b2 |
comparison
equal
deleted
inserted
replaced
5390:b3c8757ee4f4 | 5391:0d49a4e9963b |
---|---|
1 local config = require "core.configmanager"; | 1 local config = require "core.configmanager"; |
2 local certmanager = require "core.certmanager"; | 2 local certmanager = require "core.certmanager"; |
3 local server = require "net.server"; | 3 local server = require "net.server"; |
4 local socket = require "socket"; | |
4 | 5 |
5 local log = require "util.logger".init("portmanager"); | 6 local log = require "util.logger".init("portmanager"); |
6 local multitable = require "util.multitable"; | 7 local multitable = require "util.multitable"; |
7 local set = require "util.set"; | 8 local set = require "util.set"; |
8 | 9 |
17 | 18 |
18 --- Config | 19 --- Config |
19 | 20 |
20 local default_interfaces = { "*" }; | 21 local default_interfaces = { "*" }; |
21 local default_local_interfaces = { "127.0.0.1" }; | 22 local default_local_interfaces = { "127.0.0.1" }; |
22 if config.get("*", "use_ipv6") then | 23 if socket.tcp6 and config.get("*", "use_ipv6") ~= false then |
23 table.insert(default_interfaces, "::"); | 24 table.insert(default_interfaces, "::"); |
24 table.insert(default_local_interfaces, "::1"); | 25 table.insert(default_local_interfaces, "::1"); |
25 end | 26 end |
26 | 27 |
27 --- Private state | 28 --- Private state |