lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

LuaWeb (aka LW) as been updated to version 0.2.

LuaWeb is a diminutive HTTP/1.1 web server implemented in Lua.

The main change in version 0.2 is the adoption of Lua's native object method dispatching mechanism -also known as the colon notation- across the board.

LuaWeb aims to become a little web app server of sort.

Presently it offers the following services:

- File service to handle file retrieval

http://dev.alt.textdrive.com/file/LW/LWFileService.lua

- Directory service to list a directory content

http://dev.alt.textdrive.com/file/LW/LWDirectoryService.lua

- WebDAV 1.0 service

http://dev.alt.textdrive.com/file/LW/LWDAVService.lua

Additionally, LuaWeb provides a simple template mechanism to support dynamic content generation:

http://dev.alt.textdrive.com/file/LW/LWTemplate.lua

As well as an URL to Object (and vis-versa) mapping service:

http://dev.alt.textdrive.com/file/LW/LWObjectService.lua

Usage example:

-- create an application server
local anApplication = LWApplication:new( "*", 1080 )

-- create a digest authentication
local anAuthenticator = LWDigestAuthentication:new()

-- create a WebDAV service
local aService = LWDAVService:new( "/dav/", "/Path/To/Directory", anAuthenticator )

-- register the service with the application
anApplication:registerService( aService )

-- start the application
anApplication:start()

LuaWeb, while not a speed daemon, performs reasonably well compared to other libraries. Here are some numbers (requests per second) as reported by running ApacheBench on my Powerbook against the following servers:

% ab -n 1000 -c 10 -k

Lua + LuaWeb       275.10 [#/sec] (mean)
Python + CherryPy  104.07 [#/sec] (mean)
Ruby + WEBrick      24.47 [#/sec] (mean)	

LuaWeb source code is available through subversion:

svn co http://alt.textdrive.com/svn/altdev/lu/
svn co http://alt.textdrive.com/svn/altdev/LW/

Beside Lua itself (Lua 5.1 work6), LuaWeb uses the following libraries and associated dependencies:

- Klaus Ripke's slncrypto

http://luaforge.net/projects/sln/

- Kepler's LuaFileSystem

http://www.keplerproject.org/luafilesystem/

- Diego Nehab's LuaSocket

http://www.cs.princeton.edu/~diego/professional/luasocket/

- Luiz Henrique de Figueiredo's lmd5, lrandom and luuid

http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/

- Tiago Dionizio's lzlib

http://mega.ist.utl.pt/~tngd/lua/

Comments, feedbacks and rants very welcome :)

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/