Software /
code /
prosody-modules
Comparison
mod_proxy65/mod_proxy65.lua @ 72:2bf6c7c590a1
mod_proxy65: component register and deregister are with "_component" appended
author | Thilo Cestonaro <thilo@cestona.ro> |
---|---|
date | Sat, 31 Oct 2009 20:33:42 +0100 |
parent | 70:d3afb1403aa7 |
child | 73:adb9d1b879c2 |
comparison
equal
deleted
inserted
replaced
71:3c18c2d03bc2 | 72:2bf6c7c590a1 |
---|---|
19 local max_dns_depth = config.get("*", "core", "dns_max_depth") or 3; | 19 local max_dns_depth = config.get("*", "core", "dns_max_depth") or 3; |
20 local dns_timeout = config.get("*", "core", "dns_timeout") or 60; | 20 local dns_timeout = config.get("*", "core", "dns_timeout") or 60; |
21 local sha1 = require "util.hashes".sha1; | 21 local sha1 = require "util.hashes".sha1; |
22 | 22 |
23 local host, name = module:get_host(), "SOCKS5 Bytestreams Service"; | 23 local host, name = module:get_host(), "SOCKS5 Bytestreams Service"; |
24 local sessions, transfers, component, replies_cache = {}, {}, {}, nil; | 24 local sessions, transfers, component, replies_cache = {}, {}, nil, {}; |
25 | 25 |
26 local proxy_port = config_get(host, "core", "proxy65_port") or 5000; | 26 local proxy_port = config_get(host, "core", "proxy65_port") or 5000; |
27 local proxy_interface = config_get(host, "core", "proxy65_interface") or "*"; | 27 local proxy_interface = config_get(host, "core", "proxy65_interface") or "*"; |
28 local proxy_address = config_get(host, "core", "proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or module.host; | 28 local proxy_address = config_get(host, "core", "proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or module.host; |
29 | 29 |
134 reply.tags[1].attr.sid = sid; | 134 reply.tags[1].attr.sid = sid; |
135 return reply; | 135 return reply; |
136 end | 136 end |
137 | 137 |
138 module.unload = function() | 138 module.unload = function() |
139 componentmanager.deregister(host); | 139 componentmanager.deregister_component(host); |
140 connlisteners.deregister("proxy65"); | 140 connlisteners.deregister("proxy65"); |
141 end | 141 end |
142 | 142 |
143 local function set_activation(stanza) | 143 local function set_activation(stanza) |
144 local from, to, sid, reply = nil; | 144 local from, to, sid, reply = nil; |
194 if not connlisteners.register('proxy65', connlistener) then | 194 if not connlisteners.register('proxy65', connlistener) then |
195 error("mod_proxy65: Could not establish a connection listener. Check your configuration please."); | 195 error("mod_proxy65: Could not establish a connection listener. Check your configuration please."); |
196 end | 196 end |
197 | 197 |
198 connlisteners.start('proxy65'); | 198 connlisteners.start('proxy65'); |
199 component = componentmanager.register(host, handle_to_domain); | 199 component = componentmanager.register_component(host, handle_to_domain); |