Software /
code /
prosody
Comparison
plugins/mod_proxy65.lua @ 3607:e1259b6d7560
mod_proxy65: Use module:get_option() instead of configmanager.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 10 Nov 2010 22:02:28 +0500 |
parent | 3604:3e89f0509967 |
child | 3676:13a1d90b4e1c |
comparison
equal
deleted
inserted
replaced
3606:c52b06de9b27 | 3607:e1259b6d7560 |
---|---|
14 error("proxy65 should be loaded as a component, please see http://prosody.im/doc/components", 0); | 14 error("proxy65 should be loaded as a component, please see http://prosody.im/doc/components", 0); |
15 end | 15 end |
16 | 16 |
17 local jid_split, jid_join, jid_compare = require "util.jid".split, require "util.jid".join, require "util.jid".compare; | 17 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"; | 18 local st = require "util.stanza"; |
19 local config_get = require "core.configmanager".get; | |
20 local connlisteners = require "net.connlisteners"; | 19 local connlisteners = require "net.connlisteners"; |
21 local sha1 = require "util.hashes".sha1; | 20 local sha1 = require "util.hashes".sha1; |
22 local server = require "net.server"; | 21 local server = require "net.server"; |
23 | 22 |
24 local host, name = module:get_host(), "SOCKS5 Bytestreams Service"; | 23 local host, name = module:get_host(), "SOCKS5 Bytestreams Service"; |
25 local sessions, transfers, component, replies_cache = {}, {}, nil, {}; | 24 local sessions, transfers, component, replies_cache = {}, {}, nil, {}; |
26 | 25 |
27 local proxy_port = config_get(host, "core", "proxy65_port") or 5000; | 26 local proxy_port = module:get_option("proxy65_port") or 5000; |
28 local proxy_interface = config_get(host, "core", "proxy65_interface") or "*"; | 27 local proxy_interface = module:get_option("proxy65_interface") or "*"; |
29 local proxy_address = config_get(host, "core", "proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or host; | 28 local proxy_address = module:get_option("proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or host; |
30 local proxy_acl = config_get(host, "core", "proxy65_acl"); | 29 local proxy_acl = module:get_option("proxy65_acl"); |
31 local max_buffer_size = 4096; | 30 local max_buffer_size = 4096; |
32 | 31 |
33 local connlistener = { default_port = proxy_port, default_interface = proxy_interface, default_mode = "*a" }; | 32 local connlistener = { default_port = proxy_port, default_interface = proxy_interface, default_mode = "*a" }; |
34 | 33 |
35 function connlistener.onincoming(conn, data) | 34 function connlistener.onincoming(conn, data) |