plugins/mod_http.lua
changeset 4736 3514338c59c3
parent 4724 a8c234332258
child 4774 b2ed4e1bcb6e
--- a/plugins/mod_http.lua	Fri Apr 27 22:37:56 2012 +0100
+++ b/plugins/mod_http.lua	Fri Apr 27 23:11:23 2012 +0100
@@ -10,6 +10,8 @@
 
 local server = require "net.http.server";
 
+server.set_default_host(module:get_option_string("http_default_host"));
+
 local function normalize_path(path)
 	if path:sub(1,1) ~= "/" then path = "/"..path; end
 	if path:sub(-1,-1) == "/" then path = path:sub(1, -2); end
@@ -83,6 +85,11 @@
 	end
 	
 	module:handle_items("http-provider", http_app_added, http_app_removed);
+
+	server.add_host(host);
+	function module.unload()
+		server.remove_host(host);
+	end
 end
 
 module:add_item("net-provider", {