Software /
code /
prosody-modules
Comparison
mod_onions/mod_onions.lua @ 2344:c928b7ac75b7
mod_onions: Use typed config API
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 04 Nov 2016 22:33:31 +0100 |
parent | 2306:ad40c094e7d7 |
child | 2345:2df32ac11b31 |
comparison
equal
deleted
inserted
replaced
2343:f4ab0966ba89 | 2344:c928b7ac75b7 |
---|---|
22 local byte = string.byte; | 22 local byte = string.byte; |
23 local c = string.char; | 23 local c = string.char; |
24 | 24 |
25 module:depends("s2s"); | 25 module:depends("s2s"); |
26 | 26 |
27 local proxy_ip = module:get_option("onions_socks5_host") or "127.0.0.1"; | 27 local proxy_ip = module:get_option_string("onions_socks5_host", "127.0.0.1"); |
28 local proxy_port = module:get_option("onions_socks5_port") or 9050; | 28 local proxy_port = module:get_option_number("onions_socks5_port", 9050); |
29 local forbid_else = module:get_option("onions_only") or false; | 29 local forbid_else = module:get_option_boolean("onions_only", false); |
30 local torify_all = module:get_option("onions_tor_all") or false; | 30 local torify_all = module:get_option_boolean("onions_tor_all", false); |
31 local onions_map = module:get_option("onions_map") or {}; | 31 local onions_map = module:get_option("onions_map", {}); |
32 | 32 |
33 local sessions = module:shared("sessions"); | 33 local sessions = module:shared("sessions"); |
34 | 34 |
35 -- The socks5listener handles connection while still connecting to the proxy, | 35 -- The socks5listener handles connection while still connecting to the proxy, |
36 -- then it hands them over to the normal listener (in mod_s2s) | 36 -- then it hands them over to the normal listener (in mod_s2s) |