aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-20 08:56:19 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-20 08:56:19 +0000
commit5e09779c7f6b1710150d5a0f12d86ded7ede75c6 (patch)
treeffd2e2e7d918cc30015c89bd14122aa8cadb1546 /etc
parentf20f4889bfe5a02cd9b77868b90cc8042352176a (diff)
downloadluasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.tar.gz
luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.tar.bz2
luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.zip
In pre release mode!
Diffstat (limited to 'etc')
-rw-r--r--etc/README93
-rw-r--r--etc/check-memory.lua2
2 files changed, 68 insertions, 27 deletions
diff --git a/etc/README b/etc/README
index 6be740b..5a919cd 100644
--- a/etc/README
+++ b/etc/README
@@ -1,48 +1,89 @@
1This directory contains code that is more useful than the examples. This code 1This directory contains code that is more useful than the
2*is* supported. 2samples. This code *is* supported.
3 3
4 tftp.lua -- Trivial FTP client 4 tftp.lua -- Trivial FTP client
5 5
6This module implements file retrieval by the TFTP protocol. Its main use 6This module implements file retrieval by the TFTP protocol.
7was to test the UDP code, but since someone found it usefull, I turned it 7Its main use was to test the UDP code, but since someone
8into a module that is almost official (no uploads, yet). 8found it usefull, I turned it into a module that is almost
9official (no uploads, yet).
9 10
10 dict.lua -- Dict client 11 dict.lua -- Dict client
11 12
12The dict.lua module started with a cool simple client for the DICT 13The dict.lua module started with a cool simple client
13protocol, written by Luiz Henrique Figueiredo. This new version has been 14for the DICT protocol, written by Luiz Henrique Figueiredo.
14converted into a library, similar to the HTTP and FTP libraries, that can 15This new version has been converted into a library, similar
15be used from within any luasocket application. Take a look on the source 16to the HTTP and FTP libraries, that can be used from within
16code and you will be able to figure out how to use it. 17any luasocket application. Take a look on the source code
18and you will be able to figure out how to use it.
17 19
18 lp.lua -- LPD client 20 lp.lua -- LPD client library
19 21
20The lp.lua module implements the client part of the Line Printer Daemon 22The lp.lua module implements the client part of the Line
21protocol, used to print files on Unix machines. It is courtesy of David 23Printer Daemon protocol, used to print files on Unix
22Burgess and I heard he would be the one supporting it, even after I messed 24machines. It is courtesy of David Burgess! See the source
23with it. See the source code and the lpr.lua in the examples directory. 25code and the lpr.lua in the examples directory.
26
27 b64.lua
28 qp.lua
29 eol.lua
30
31These are tiny programs that perform Base64,
32Quoted-Printable and end-of-line marker conversions.
24 33
25 get.lua -- file retriever 34 get.lua -- file retriever
26 35
27This little program is a client that uses the FTP and HTTP code to 36This little program is a client that uses the FTP and
28implement a command line file graber. Just run 37HTTP code to implement a command line file graber. Just
38run
29 39
30 lua get.lua <remote-file> [<local-file>] 40 lua get.lua <remote-file> [<local-file>]
31 41
32to download a remote file (either ftp:// or http://) to the specified 42to download a remote file (either ftp:// or http://) to
33local file. The program also prints the download throughput, elapsed 43the specified local file. The program also prints the
34time, bytes already downloaded etc during download. 44download throughput, elapsed time, bytes already downloaded
45etc during download.
46
47 check-memory.lua -- checks memory consumption
48
49This is just to see how much memory each module uses.
50
51 dispatch.lua -- coroutine based dispatcher
52
53This is a first try at a coroutine based non-blocking
54dispatcher for LuaSocket. Take a look at 'check-links.lua'
55and at 'forward.lua' to see how to use it.
35 56
36 check-links.lua -- HTML link checker program 57 check-links.lua -- HTML link checker program
37 58
38This little program scans a HTML file and checks for broken links. It is 59This little program scans a HTML file and checks for broken
39similar to check-links.pl by Jamie Zawinski, but uses all facilities of 60links. It is similar to check-links.pl by Jamie Zawinski,
40the LuaSocket library and the Lua language. It has not been thoroughly 61but uses all facilities of the LuaSocket library and the Lua
41tested, but it should work. Just run 62language. It has not been thoroughly tested, but it should
63work. Just run
64
65 lua check-links.lua [-n] {<url>} > output
66
67and open the result to see a list of broken links. You can
68also use the '-n' switch to run the same program in
69non-blocking mode to see how much faster things can get.
70
71 forward.lua -- coroutine based forward server
72
73This is a forward server that can accept several connections
74and transfers simultaneously using non-blocking I/O and the
75coroutine-based dispatcher. You can run, for example
76
77 lua forward.lua 8080:proxy.com:3128
78
79to redirect all local conections to port 8080 to the host
80'proxy.com' at port 3128.
42 81
43 lua check-links.lua {<url>} > output 82 unix.c and unix.h
44 83
45and open the result to see a list of broken links. 84This is an implementation of Unix local domain sockets and
85demonstrates how to extend LuaSocket with a new type of
86transport. It has been tested on Linux and on Mac OS X.
46 87
47Good luck, 88Good luck,
48Diego. 89Diego.
diff --git a/etc/check-memory.lua b/etc/check-memory.lua
index 7bcdf67..7bd984d 100644
--- a/etc/check-memory.lua
+++ b/etc/check-memory.lua
@@ -7,7 +7,7 @@ function load(s)
7 print(s .. ":\t " .. (b-a) .. "k") 7 print(s .. ":\t " .. (b-a) .. "k")
8end 8end
9 9
10load("url") 10load("socket.url")
11load("ltn12") 11load("ltn12")
12load("socket") 12load("socket")
13load("mime") 13load("mime")