57 local port = (udata and udata.port) or h.default_port or error("Can't start listener "..name.." because no port was specified, and it has no default port", 0); |
57 local port = (udata and udata.port) or h.default_port or error("Can't start listener "..name.." because no port was specified, and it has no default port", 0); |
58 local mode = (udata and udata.mode) or h.default_mode or 1; |
58 local mode = (udata and udata.mode) or h.default_mode or 1; |
59 local ssl = (udata and udata.ssl) or nil; |
59 local ssl = (udata and udata.ssl) or nil; |
60 local autossl = udata and udata.type == "ssl"; |
60 local autossl = udata and udata.type == "ssl"; |
61 |
61 |
|
62 if autossl and not ssl then |
|
63 return nil, "no ssl context"; |
|
64 end |
|
65 |
62 return server.addserver(interface, port, h, mode, autossl and ssl or nil); |
66 return server.addserver(interface, port, h, mode, autossl and ssl or nil); |
63 end |
67 end |
64 |
68 |
65 return _M; |
69 return _M; |