Commits

Thijs Alkemade committed f0fad5e

Imitating mod_s2s in how to add this hook.

  • Participants
  • Parent commits adaf1b6

Comments (0)

Files changed (1)

File mod_onions.lua

 	return false;
 end, 100);
 
-module:hook("route/remote", function(event)
+local function route_to_onion(event)
 
 	if not event.to_host:find(".onion(.?)$") then
 		module:log("debug", event.to_host .. " is not an onion. Not doing anything.");
-		return;
+		return false;
 	end
 
 	module:log("debug", "Onion routing something to ".. event.to_host);
 	connect_socks5(host_session, event.to_host, 5269);
 
 	return false;
-end, 250);
+end
+
+function module.add_host(module)
+	module:hook("route/remote", route_to_onion, 200);
+end