lua-users home
lua-l archive

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

On Jul 22, 2007, at 04:14, Javier Guerra Giraldez wrote:

still, for most projects, i'm more and more turning to DJ. Bernstein's tools (like PA mentioned).

Another beneficial side effect of using something like tcpserver is that you can test your code without necessarily running it over a network connection... in other words, because your script only external dependencies are io.stdin and io.stdout, you can very well run your HTTP server or what not as a regular Lua script directly from the command line for testing purpose...

Instead of:

% ./tcpserver 0 1080 lua TestHTTP.lua

One could run it directly from the command line:

% lua TestHTTP.lua

GET / HTTP/1.1

HTTP/1.1 302 Found
Connection: keep-alive
Content-Type: text/plain
Content-Length: 21
Location: http://localhost/main
Content-Md5: 9f643077560617fa7b634566e379542b
Date: Sun, 22 Jul 2007 08:51:31 GMT