Software / code / prosody
Comparison
plugins/mod_bosh.lua @ 1537:6670af04aeb6
mod_bosh: Use new httpserver helper to initialise ports
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 12 Jul 2009 15:21:10 +0100 |
| parent | 1522:569d58d21612 |
| child | 1541:591732da1306 |
comparison
equal
deleted
inserted
replaced
| 1536:8214458eacc8 | 1537:6670af04aeb6 |
|---|---|
| 274 end | 274 end |
| 275 end | 275 end |
| 276 end | 276 end |
| 277 | 277 |
| 278 local ports = config.get(module.host, "core", "bosh_ports") or { 5280 }; | 278 local ports = config.get(module.host, "core", "bosh_ports") or { 5280 }; |
| 279 for _, options in ipairs(ports) do | 279 httpserver.new_from_config(ports, handle_request); |
| 280 local port, base, ssl, interface = 5280, "http-bind", false, nil; | |
| 281 if type(options) == "number" then | |
| 282 port = options; | |
| 283 elseif type(options) == "table" then | |
| 284 port, base, ssl, interface = options.port or 5280, options.path or "http-bind", options.ssl or false, options.interface; | |
| 285 elseif type(options) == "string" then | |
| 286 base = options; | |
| 287 end | |
| 288 httpserver.new{ port = port, base = base, handler = handle_request, ssl = ssl } | |
| 289 end | |
| 290 | 280 |
| 291 server.addtimer(on_timer); | 281 server.addtimer(on_timer); |