Trying to invoke httpd() in an interface script...
Posted: 14 Jun 2013 06:20
I start VLC with the following command:
This seems to find the rest.lua script located in ~/Library/Application\ Support/org.videolan.vlc/lua/intf directory (and boy was it tough figuring out the correct parameters... not to mention that the readme has the wrong directory for lua scripts, claims ~/Library/Preferences).
The lua script itself is currently barebones, has the following content:
Please note that I've only ever tried with non-privileged ports (1025 and above). I've tried various IP addresses, in addition to the * star. The output I get from Terminal.app always looks like this:
Notice how it tries port 8080... I'm not sure if that's relevant, or only happens because my code is throwing other errors.
Can anyone help me get to a point where I have it serving up simple webpages (eventually I want it to serve JSON data) ?
Code: Select all
/Applications/VLC.app/Contents/MacOS/VLC -vvv --extraintf=luaintf --lua-intf rest
The lua script itself is currently barebones, has the following content:
Code: Select all
require "common"
vlc.msg.info("Lua REST interface")
h = vlc.httpd("*", 32009)
a = h:handler("/test",nil,nil,test_f,nil)
Code: Select all
[0x100280530] [rest] main interface debug: net: listening to * port 8080
[0x100280530] [rest] lua interface error: Error loading script /Users/john/Library/Application Support/org.videolan.vlc/lua/intf/rest.lua: ...plication Support/org.videolan.vlc/lua/intf/rest.lua:53: bad argument #4 to 'handler' (acl expected, got function)
Can anyone help me get to a point where I have it serving up simple webpages (eventually I want it to serve JSON data) ?