# HG changeset patch # User Thijs Alkemade # Date 1370893188 -7200 # Node ID f4031e7ccec15e74e9784047bb983b8cc2bb92b9 # Parent 25b83ed7838ac9f825f20aff8e23cb7d5cbc085e mod_onions: The SOCKS5 port is now a string, as it should be. Added a boolean option onions_tor_all to pass all s2s traffic through Tor. diff -r 25b83ed7838a -r f4031e7ccec1 mod_onions/mod_onions.lua --- a/mod_onions/mod_onions.lua Mon Jun 10 20:59:39 2013 +0200 +++ b/mod_onions/mod_onions.lua Mon Jun 10 21:39:48 2013 +0200 @@ -8,14 +8,15 @@ local c = string.char; local proxy_ip = module:get_option("onions_socks5_host") or "127.0.0.1"; -local proxy_port = module:get_option("onions_socks5_port") or "9050"; +local proxy_port = module:get_option("onions_socks5_port") or 9050; local forbid_else = module:get_option("onions_only") or false; +local torify_all = module:get_option("onions_tor_all") or false; local sessions = module:shared("sessions"); -- The socks5listener handles connection while still connecting to the proxy, -- then it hands them over to the normal listener (in mod_s2s) -local socks5listener = { default_port = tonumber(proxy_port), default_mode = "*a", default_interface = "*" }; +local socks5listener = { default_port = proxy_port, default_mode = "*a", default_interface = "*" }; local function socks5_connect_sent(conn, data) @@ -215,7 +216,7 @@ if forbid_else then module:log("debug", event.to_host .. " is not an onion. Blocking it."); return false; - else + elseif not torify_all then return; end end