warn('[http] the "reuseport" option is disabled and multiple forks are used, ' ..
'port binding will fail on some instances')
end
+ -- Check if UNIX socket path is used
+ local addr_str
+ if not conf.path then
+ conf.host = conf.host or 'localhost'
+ conf.port = conf.port or 8053
+ addr_str = string.format('%s@%d', conf.host, conf.port)
+ else
+ if conf.host or conf.port then
+ error('either "path", or "host" and "port" must be provided')
+ end
+ addr_str = conf.path
+ end
-- Create TLS context and start listening
local s, err = http_server.listen {
cq = worker.bg_worker.cq,
- host = conf.host or 'localhost',
- port = conf.port or 8053,
+ host = conf.host,
+ port = conf.port,
+ path = conf.path,
v6only = conf.v6only,
+ unlink = conf.unlink,
reuseaddr = conf.reuseaddr,
reuseport = reuseport,
client_timeout = conf.client_timeout or 5,
err = select(2, s:listen())
end
if err then
- panic('failed to listen on %s@%d: %s', conf.host, conf.port, err)
+ panic('failed to listen on %s: %s', addr_str, err)
end
table.insert(M.servers, s)
-- Create certificate renewal timer if ephemeral