Lines Matching refs:httpd
3 -- this small Lua script demonstrates the use of Lua in (bozo)httpd
12 -- /usr/libexec/httpd -b -f -I 8080 -L test printenv.lua .
15 local httpd = require 'httpd'
26 -- output headers using httpd.write()
27 -- httpd.write() will not append newlines
28 httpd.write("HTTP/1.1 200 Ok\r\n")
29 httpd.write("Content-Type: text/html\r\n\r\n")
31 -- output html using httpd.print()
33 httpd.print([[
42 httpd.print('module version: ' .. httpd._VERSION .. '<br>')
44 httpd.print('<h2>Server Environment</h2>')
47 httpd.print(escape_html(k) .. '=' .. escape_html(v) .. '<br/>')
50 httpd.print('<h2>Request Headers</h2>')
52 httpd.print(escape_html(k) .. '=' .. escape_html(v) .. '<br/>')
56 httpd.print('<h2>Query Variables</h2>')
58 httpd.print(escape_html(k) .. '=' .. escape_html(v) .. '<br/>')
62 httpd.print('<h2>Form Test</h2>')
64 httpd.print([[
71 httpd.print([[
79 httpd.write("HTTP/1.1 200 Ok\r\n")
80 httpd.write("Content-Type: text/html\r\n\r\n")
83 httpd.print('<h2>Form Variables</h2>')
86 httpd.print('Content-type: ' .. env.CONTENT_TYPE .. '<br>')
90 httpd.print(escape_html(k) .. '=' .. escape_html(v) .. '<br/>')
93 httpd.print('No values')
98 httpd.register_handler('printenv', printenv)
99 httpd.register_handler('form', form)