Comparison

plugins/mod_proxy65.lua @ 3689:2ca76b4f6404

mod_proxy65: Allow loading on normal hosts.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 03 Dec 2010 00:04:32 +0500
parent 3688:f7de887ea0be
child 3690:8f9fac97e6e6
comparison
equal deleted inserted replaced
3688:f7de887ea0be 3689:2ca76b4f6404
8 module:unload("proxy65"); 8 module:unload("proxy65");
9 > server.removeserver(<proxy65_port>); 9 > server.removeserver(<proxy65_port>);
10 module:load("proxy65", <proxy65_jid>); 10 module:load("proxy65", <proxy65_jid>);
11 ]]-- 11 ]]--
12 12
13 if module:get_host_type() ~= "component" then
14 error("proxy65 should be loaded as a component, please see http://prosody.im/doc/components", 0);
15 end
16 13
17 local jid_split, jid_join, jid_compare = require "util.jid".split, require "util.jid".join, require "util.jid".compare; 14 local jid_split, jid_join, jid_compare = require "util.jid".split, require "util.jid".join, require "util.jid".compare;
18 local st = require "util.stanza"; 15 local st = require "util.stanza";
19 local connlisteners = require "net.connlisteners"; 16 local connlisteners = require "net.connlisteners";
20 local sha1 = require "util.hashes".sha1; 17 local sha1 = require "util.hashes".sha1;
21 local server = require "net.server"; 18 local server = require "net.server";
22 19
23 local host, name = module:get_host(), "SOCKS5 Bytestreams Service"; 20 local host, name = module:get_host(), "SOCKS5 Bytestreams Service";
24 local sessions, transfers, component, replies_cache = {}, {}, nil, {}; 21 local sessions, transfers, replies_cache = {}, {}, {};
25 22
26 local proxy_port = module:get_option("proxy65_port") or 5000; 23 local proxy_port = module:get_option("proxy65_port") or 5000;
27 local proxy_interface = module:get_option("proxy65_interface") or "*"; 24 local proxy_interface = module:get_option("proxy65_interface") or "*";
28 local proxy_address = module:get_option("proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or host; 25 local proxy_address = module:get_option("proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or host;
29 local proxy_acl = module:get_option("proxy65_acl"); 26 local proxy_acl = module:get_option("proxy65_acl");