Note: availability of the different VLC specific Lua modules depends on
the type of VLC Lua script your are in.
-Access lists
-------------
-local a = vlc.acl(true) -> new ACL with default set to allow
-a:check("10.0.0.1") -> 0 == allow, 1 == deny, -1 == error
-a("10.0.0.1") -> same as a:check("10.0.0.1")
-a:duplicate() -> duplicate ACL object
-a:add_host("10.0.0.1",true) -> allow 10.0.0.1
-a:add_net("10.0.0.0",24,true) -> allow 10.0.0.0/24 (not sure)
-a:load_file("/path/to/acl") -> load ACL from file
-
Configuration
-------------
config.get( name ): Get the VLC configuration option "name"'s value.
http( host, port, [cert, key, ca, crl]): create a new HTTP (SSL) daemon.
local h = vlc.httpd( "localhost", 8080 )
-h:handler( url, user, password, acl, callback, data ) -- add a handler for given url. If user and password are non nil, they will be used to authenticate connecting clients. If acl is non nil, it will be used to restrict access. callback will be called to handle connections. The callback function takes 7 arguments: data, url, request, type, in, addr, host. It returns the reply as a string.
-h:file( url, mime, user, password, acl, callback, data ) -- add a file for given url with given mime type. If user and password are non nil, they will be used to authenticate connecting clients. If acl is non nil, it will be used to restrict access. callback will be called to handle connections. The callback function takes 2 arguments: data and request. It returns the reply as a string.
+h:handler( url, user, password, callback, data ) -- add a handler for given url. If user and password are non nil, they will be used to authenticate connecting clients. callback will be called to handle connections. The callback function takes 7 arguments: data, url, request, type, in, addr, host. It returns the reply as a string.
+h:file( url, mime, user, password, callback, data ) -- add a file for given url with given mime type. If user and password are non nil, they will be used to authenticate connecting clients. callback will be called to handle connections. The callback function takes 2 arguments: data and request. It returns the reply as a string.
h:redirect( url_dst, url_src ): Redirect all connections from url_src to url_dst.
Input
misc.mdate(): Get the current date (in microseconds).
misc.mwait(): Wait for the given date (in microseconds).
-misc.lock_and_wait(): Lock our object thread and wait for a wake up signal.
-
misc.should_die(): Returns true if the interface should quit.
misc.quit(): Quit VLC.
-misc.timer(callback): Create a timer which call the callback function
- :schedule(relative, value, interval): schedule the timer
- :getoverrun(): number of time the timer got overrun (normally 0)
-
Net
---
net.url_parse( url, [option delimiter] ): Parse URL. Returns a table with
to "value". Created vars can be of type float, string, bool or void.
For a void variable the value has to be 'nil'.
-var.add_callback( object, name, function, data ): Add a callback to the
- object's "name" variable. Callback functions take 4 arguments: the
- variable name, the old value, the new value and data.
-var.del_callback( object, name, function, data ): Delete a callback to
- the object's "name" variable. "function" and "data" must be the same as
- when add_callback() was called.
var.trigger_callback( object, name ): Trigger the callbacks associated with the
object's "name" variable.