[vlc-devel] commit: Make the lua http interface host and directory configurable. ( Antoine Cellerier )

git version control git at videolan.org
Sat Mar 8 16:16:55 CET 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat Mar  8 15:38:43 2008 +0100| [ab620e32135cc274bff54297ba2301a3d2ed2c78]

Make the lua http interface host and directory configurable.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ab620e32135cc274bff54297ba2301a3d2ed2c78
---

 share/luaintf/http.lua |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/share/luaintf/http.lua b/share/luaintf/http.lua
index ee36df7..1e6d775 100644
--- a/share/luaintf/http.lua
+++ b/share/luaintf/http.lua
@@ -23,6 +23,8 @@
 
 --[==========================================================================[
 Configuration options:
+ * host: A host to listen on.
+ * dir: Directory to use a the http interface's root.
  * no_error_detail: If set, do not print the Lua error message when generating
                     a page fails.
  * no_index: If set, don't build directory indexes
@@ -188,7 +190,7 @@ local function find_datadir(name)
     end
     error("Unable to find the `"..name.."' directory.")
 end
-http_dir = find_datadir("http-lua")
+http_dir = config.dir or find_datadir("http-lua")
 
 do
     local oldpath = package.path
@@ -260,7 +262,8 @@ local function load_dir(dir,root,parent_acl)
     end
 end
 
-h = httpd.new("localhost",8080)
+local u = vlc.net.url_parse( config.host or "localhost:8080" )
+h = httpd.new(u.host,u.port)
 load_dir( http_dir )
 
 while not die do die = vlc.lock_and_wait() end -- everything happens in callbacks




More information about the vlc-devel mailing list