aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-11-28 08:17:16 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-11-28 08:17:16 +0000
commit534b0cedf714d4de0a6cf67570e11f232cdccf84 (patch)
tree14b26a6a8460e57c9739025eb0e661f64bb78b4f
parent297b32e828b76ee544c9d4f89f996eda78830cc0 (diff)
downloadluasocket-534b0cedf714d4de0a6cf67570e11f232cdccf84.tar.gz
luasocket-534b0cedf714d4de0a6cf67570e11f232cdccf84.tar.bz2
luasocket-534b0cedf714d4de0a6cf67570e11f232cdccf84.zip
Added new instalation section to the manual.
-rw-r--r--TODO6
-rw-r--r--doc/dns.html4
-rw-r--r--doc/ftp.html4
-rw-r--r--doc/http.html4
-rw-r--r--doc/index.html84
-rw-r--r--doc/installation.html149
-rw-r--r--doc/introduction.html39
-rw-r--r--doc/ltn12.html6
-rw-r--r--doc/mime.html4
-rw-r--r--doc/reference.html5
-rw-r--r--doc/smtp.html5
-rw-r--r--doc/socket.html4
-rw-r--r--doc/tcp.html4
-rw-r--r--doc/udp.html4
-rw-r--r--doc/url.html4
-rw-r--r--src/socket.lua25
-rw-r--r--test/httptest.lua2
17 files changed, 264 insertions, 89 deletions
diff --git a/TODO b/TODO
index dfb9178..c366bf6 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,3 @@
1use wim's filter.chain or something better
2make sure standard libraries are "required" by modules before use.
3eliminate globals from namespaces created by module().
4ftp.send/recv return bytes transfered? 1ftp.send/recv return bytes transfered?
5new scheme to choose family/protocol of object to create 2new scheme to choose family/protocol of object to create
6change ltn13 to make sure drawbacks are obvious 3change ltn13 to make sure drawbacks are obvious
@@ -23,6 +20,9 @@ testar os options!
23 - proteger ou atomizar o conjunto (timedout, receive), (timedout, send) 20 - proteger ou atomizar o conjunto (timedout, receive), (timedout, send)
24 - inet_ntoa também é uma merda. 21 - inet_ntoa também é uma merda.
25 22
23*eliminate globals from namespaces created by module().
24*make sure standard libraries are "required" by modules before use.
25*use wim's filter.chain or something better
26*close wasn't returning 1 26*close wasn't returning 1
27*make sure errors not thrown by try() are not caught by protect() 27*make sure errors not thrown by try() are not caught by protect()
28*move wsocket.c:sock_send kludge to buffer.c:sendraw? 28*move wsocket.c:sock_send kludge to buffer.c:sendraw?
diff --git a/doc/dns.html b/doc/dns.html
index 09a9bdb..2c4c51f 100644
--- a/doc/dns.html
+++ b/doc/dns.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: DNS support"> 6<meta name="description" content="LuaSocket: DNS support">
7<meta name="keywords" content="Lua, Library, DNS, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, DNS, Network, Library, Support">
8<title>LuaSocket: DNS support</title> 8<title>LuaSocket: DNS support</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -114,6 +115,7 @@ message.
114<p class=bar> 115<p class=bar>
115<a href="home.html">home</a> &middot; 116<a href="home.html">home</a> &middot;
116<a href="home.html#down">download</a> &middot; 117<a href="home.html#down">download</a> &middot;
118<a href="instalation.html">instalation</a> &middot;
117<a href="introduction.html">introduction</a> &middot; 119<a href="introduction.html">introduction</a> &middot;
118<a href="reference.html">reference</a> 120<a href="reference.html">reference</a>
119</p> 121</p>
diff --git a/doc/ftp.html b/doc/ftp.html
index 0b52007..a1a5162 100644
--- a/doc/ftp.html
+++ b/doc/ftp.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: FTP support"> 6<meta name="description" content="LuaSocket: FTP support">
7<meta name="keywords" content="Lua, Library, FTP, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, FTP, Network, Library, Support">
8<title>LuaSocket: FTP support</title> 8<title>LuaSocket: FTP support</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -265,6 +266,7 @@ f, e = ftp.put{
265<p class=bar> 266<p class=bar>
266<a href="home.html">home</a> &middot; 267<a href="home.html">home</a> &middot;
267<a href="home.html#download">download</a> &middot; 268<a href="home.html#download">download</a> &middot;
269<a href="instalation.html">instalation</a> &middot;
268<a href="introduction.html">introduction</a> &middot; 270<a href="introduction.html">introduction</a> &middot;
269<a href="reference.html">reference</a> 271<a href="reference.html">reference</a>
270</p> 272</p>
diff --git a/doc/http.html b/doc/http.html
index 13acd1c..deacaa5 100644
--- a/doc/http.html
+++ b/doc/http.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: HTTP support"> 6<meta name="description" content="LuaSocket: HTTP support">
7<meta name="keywords" content="Lua, Library, HTTP, WWW, browser, Network, Support"> 7<meta name="keywords" content="Lua, HTTP, Library, WWW, Browser, Network, Support">
8<title>LuaSocket: HTTP support</title> 8<title>LuaSocket: HTTP support</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -27,6 +27,7 @@
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 29<a href="introduction.html">introduction</a> &middot;
30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
32</center> 33</center>
@@ -299,6 +300,7 @@ r, c = http.request {
299<p class=bar> 300<p class=bar>
300<a href="home.html">home</a> &middot; 301<a href="home.html">home</a> &middot;
301<a href="home.html#download">download</a> &middot; 302<a href="home.html#download">download</a> &middot;
303<a href="instalation.html">instalation</a> &middot;
302<a href="introduction.html">introduction</a> &middot; 304<a href="introduction.html">introduction</a> &middot;
303<a href="reference.html">reference</a> 305<a href="reference.html">reference</a>
304</p> 306</p>
diff --git a/doc/index.html b/doc/index.html
index c0a46ea..c3c391f 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="The LuaSocket Homepage"> 6<meta name="description" content="The LuaSocket Homepage">
7<meta name="keywords" content="Lua, Library, Network, Support, Internet"> 7<meta name="keywords" content="Lua, LuaSocket, Network, Library, Support, Internet">
8<title>LuaSocket: Network support for the Lua language </title> 8<title>LuaSocket: Network support for the Lua language </title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -79,7 +80,7 @@ LuaSocket.
79</p> 80</p>
80 81
81<p> 82<p>
82Copyright &copy; 1999-2004 Tecgraf/PUC-Rio. All rights reserved. <br> 83Copyright &copy; 2004 Diego Nehab. All rights reserved. <br>
83Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a> 84Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
84</p> 85</p>
85 86
@@ -88,7 +89,7 @@ Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
88<h2 id=download>Download</h2> 89<h2 id=download>Download</h2>
89 90
90<p> 91<p>
91LuaSocket version 2.0 beta2 is now available for download! It is 92LuaSocket version 2.0 (beta3) is now available for download! It is
92compatible with Lua&nbsp;5.0 and has been tested on 93compatible with Lua&nbsp;5.0 and has been tested on
93Windows&nbsp;XP, Linux, and Mac OS X. 94Windows&nbsp;XP, Linux, and Mac OS X.
94</p> 95</p>
@@ -99,8 +100,8 @@ The library can be downloaded in source code from the following links:
99 100
100<blockquote> 101<blockquote>
101<p> 102<p>
102<a href="luasocket-2.0-beta2.tar.gz">luasocket-2.0-beta2.tar.gz</a> <br> 103<a href="luasocket-2.0-beta3.tar.gz">luasocket-2.0-beta3.tar.gz</a> <br>
103<a href="luasocket-2.0-beta2.zip">luasocket-2.0-beta2.zip</a> 104<a href="luasocket-2.0-beta3.zip">luasocket-2.0-beta3.zip</a>
104</p> 105</p>
105</blockquote> 106</blockquote>
106 107
@@ -116,7 +117,7 @@ LuaSocket a quick try:
116 117
117<blockquote> 118<blockquote>
118<p> 119<p>
119<a href="luasocket-2.0-beta2-win32.zip">luasocket-2.0-beta2-win32.zip</a> 120<a href="luasocket-2.0-beta3-win32.zip">luasocket-2.0-beta3-win32.zip</a>
120</p> 121</p>
121</blockquote> 122</blockquote>
122 123
@@ -124,11 +125,15 @@ LuaSocket a quick try:
124The quick and dirty way to use these binaries is to unpack everything into a 125The quick and dirty way to use these binaries is to unpack everything into a
125directory, say <tt>c:\luasocket</tt> (include all Lua files from the 126directory, say <tt>c:\luasocket</tt> (include all Lua files from the
126LuaSocket distrbitution in the same directory too!). 127LuaSocket distrbitution in the same directory too!).
127Then set <tt>LUA_INIT</tt> to load the <tt>lua.lua</tt> helper file: 128Then set <tt>LUA_INIT</tt> to load the <tt>compat-5.1.lua</tt> and set
129<tt>LUA_PATH</tt> and <tt>LUA_CPATH</tt> to look for files in that
130directory:
128</p> 131</p>
129 132
130<pre class=example> 133<pre class=example>
131c:\luasocket\&gt; set LUA_INIT=@lua.lua 134c:\luasocket\&gt; set LUA_INIT=@compat-5.1.lua
135c:\luasocket\&gt; set LUA_CPATH=?.dll
136c:\luasocket\&gt; set LUA_PATH=?.lua
132</pre> 137</pre>
133 138
134<p> 139<p>
@@ -142,9 +147,13 @@ c:\luasocket\&gt; lua
142Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio 147Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
143&gt; http = require"http" 148&gt; http = require"http"
144&gt; print(http.request"http://www.tecgraf.puc-rio.br/luasocket/") 149&gt; print(http.request"http://www.tecgraf.puc-rio.br/luasocket/")
145--&gt; this file 150--&gt; this gets dumped to terminal
146</pre> 151</pre>
147 152
153<p> Take a look at the <a href=instalation.html>installation</a> section of
154the manual to find out how to properly install the library after you are
155done playing with it. </p>
156
148<!-- thanks +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 157<!-- thanks +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
149 158
150<h2 id=thanks>Special thanks</h2> 159<h2 id=thanks>Special thanks</h2>
@@ -165,35 +174,31 @@ has been helping a lot too! Thanks to you all!
165<h2 id=new>What's New</h2> 174<h2 id=new>What's New</h2>
166 175
167<p> 176<p>
168Changes in the 2.0-beta2 were mostly bug-fixes. 177The big change for the 2.0 (beta3) release was the adoption of the Lua 5.1
178package proposal. There were several bug fixes too (a beta is a
179beta, is a beta).
169</p> 180</p>
170 181
171<ul> 182<ul>
172<li> Fixed silly last-minute-change bug in HTTP/SMTP; 183<li> New compat-5.1 distribution:
173<li> <tt>usocket.c</tt>/<tt>wsocket.c</tt> look nicer thanks to Mike; 184<ul>
174<li> Finally total timeout is reliable on Windows! (found a pretty 185<li> Instalation uses new directory structure;
175simple work around); 186<li> Namespace hierarchy is in now back in use (ex. <tt>socket.url</tt>
176<li> UDP has a reasonable maximum datagram size (8k); 187 instead of <tt>url</tt>);
177<li> <tt>Receive</tt> accepts the prefix optional argument (good for 188<li> Globals not visible from inside namespaces;
178non-blocking); 189<li> All modules call <tt>require</tt> even for standard libraries;
179<li> <b><tt>Send</tt> doesn't support multiple arguments anymore</b>; 190</ul>
180<li> Instead, <tt>send</tt> allows the selection of the substring 191<li> LTN12 avoids coroutines (so you can go wild on the C side);
181to be sent (good for non-blocking); 192<li> Kludge on wsocket.c:sock_send for windows timeout issue
182<li> Fixed bug that caused select return tables not to be associative 193 moved to buffer.c:sendraw;
183on windows; 194<li> <tt>socket.protect </tt>only catches errors thrown by <tt>socket.try</tt>;
184<li> Should compile with g++; 195<li> Fixed <tt>udp:sendto</tt> to call <tt>sock_sendto</tt> instead of
185<li> New sample unix domain support; 196 <tt>sock_send</tt>;
186<li> New sample LPD support; 197<li> <tt>close</tt> wasn't returning 1!
187<li> Comprehensive error messages; 198<li> <tt>socket.gettime</tt> returns time since Unix Epoch 1/1/1970 (UTC)
188<li> New <tt>getstats</tt> and <tt>setstats</tt> methods to help throttling; 199<li> <tt>socket.sleep</tt> is robust to interrupts;
189<li> <tt>Listen</tt> defaults to 32 backlog; 200<li> <tt>socket.select</tt> wasn't calling <tt>tm_markstart</tt>;
190<li> SMTP/FTP/HTTP fail gracefully; 201<li> <tt>http.PROXY</tt> etc wasn't working.
191<li> <tt>accept</tt>/<tt>connect</tt>/<tt>select</tt> interrupt safe
192<li> Fixed bug that didn't set accepted sockets as non-blocking
193<li> <b>New timming functions <tt>sleep</tt> and <tt>gettime</tt> have
194higher resolution and no wrap around problems</b>;
195<li> Bug fixes in the manual;
196<li> Fixed bug of missing cast in <tt>getfd</tt>.
197</ul> 202</ul>
198 203
199<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 204<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -201,10 +206,9 @@ higher resolution and no wrap around problems</b>;
201<h3 id=incompatible>Incompatibilities with previous versions</h3> 206<h3 id=incompatible>Incompatibilities with previous versions</h3>
202 207
203<ul> 208<ul>
204 209<li> Namespaces are hierarchical again. This means that whoever called
205<li> New <tt>send</tt> inteface doesn't send multiple arguments anymore; 210<tt>require("url")</tt> should update their code to
206<li> <tt>Time</tt> is replaced by <tt>gettime</tt> with advantage. 211<tt>require("socket.url")</tt>.
207
208</ul> 212</ul>
209 213
210<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 214<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -225,6 +229,8 @@ those that have compatibility issues.
225<center> 229<center>
226<p class=bar> 230<p class=bar>
227<a href="home.html#down">download</a> &middot; 231<a href="home.html#down">download</a> &middot;
232<a href="home.html#download">download</a> &middot;
233<a href="instalation.html">instalation</a> &middot;
228<a href="introduction.html">introduction</a> &middot; 234<a href="introduction.html">introduction</a> &middot;
229<a href="reference.html">reference</a> 235<a href="reference.html">reference</a>
230</p> 236</p>
diff --git a/doc/installation.html b/doc/installation.html
new file mode 100644
index 0000000..d5e82d9
--- /dev/null
+++ b/doc/installation.html
@@ -0,0 +1,149 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4
5<head>
6<meta name="description" content="LuaSocket: Introduction to the core">
7<meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network, Support,
8Installation">
9<title>LuaSocket: Instalation</title>
10<link rel="stylesheet" href="reference.css" type="text/css">
11</head>
12
13<body>
14
15<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
16
17<div class=header>
18<hr>
19<center>
20<table summary="LuaSocket logo">
21<tr><td align=center><a href="http://www.lua.org">
22<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
23</a></td></tr>
24<tr><td align=center valign=top>Network support for the Lua language
25</td></tr>
26</table>
27<p class=bar>
28<a href="home.html">home</a> &middot;
29<a href="home.html#download">download</a> &middot;
30<a href="instalation.html">instalation</a> &middot;
31<a href="introduction.html">introduction</a> &middot;
32<a href="reference.html">reference</a>
33</p>
34</center>
35<hr>
36</div>
37
38<!-- instalation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
39
40<h2>Instalation</h2>
41
42<p> LuaSocket 2.0 uses the new package proposal for Lua 5.1, throught the
43compatibility module <a href=http://www.keplerproject.org/compat/>
44Compat-5.1</a> released in conjunction with Roberto Ierusalimschy and <a
45href=http://www.keplerproject.org/">The Kepler project</a>. The proposal
46was considered important enough by the community to justify early adoption.
47All Lua library developers are encouraged to change their libraries in
48preparation for the release of Lua 5.1. </p>
49
50<p> As far as LuaSocket is concerned, this means that whoever is
51deploying a solution that uses LuaSocket has a lot of freedom. Here we
52describe only the standard distribution. If the standard doesn't meet your
53needs, we refer you to the Lua discussion list, where any quesetion about
54the package scheme will likely be answered promptly.
55</p>
56
57<h3>Directory structure</h3>
58
59<p> The new package scheme has a root directory for the libraries installed
60on a given system. Let's call this directory <tt>&lt;ROOT&gt;</tt>.
61On my system, this is the <tt>/usr/local/share/lua/5.0</tt> directory.
62Here is the standard LuaSocket distribution directory structure:</p>
63
64<pre class=example>
65&lt;ROOT&gt;/compat-5.1.lua
66&lt;ROOT&gt;/socket.lua
67&lt;ROOT&gt;/lsocket.dll
68&lt;ROOT&gt;/mime.lua
69&lt;ROOT&gt;/lmime.dll
70&lt;ROOT&gt;/ltn12.lua
71&lt;ROOT&gt;/socket/http.lua
72&lt;ROOT&gt;/socket/tp.lua
73&lt;ROOT&gt;/socket/ftp.lua
74&lt;ROOT&gt;/socket/smtp.lua
75&lt;ROOT&gt;/socket/url.lua
76</pre>
77
78<p> Naturally, on Unix systems, <tt>lsocket.dll</tt> and <tt>lmime.dll</tt>
79would be replaced by <tt>lsocket.so</tt> and <tt>lmime.so</tt>. In Mac OS
80X, they would be replaced by <tt>lsocket.dylib</tt> and
81<tt>lmime.dylib</tt>. </p>
82
83<p> In order for the interpreter to find all LuaSocket components, three
84environment variables need to be set. The first environment variable tells
85the interpreter to load the <tt>compat-5.1.lua</tt> module. </p>
86
87<pre class=example>
88LUA_INIT=@&lt;ROOT&gt;/compat-5.1.lua
89</pre>
90
91The other two environment variables instruct the compatibility module to
92look for dynamic libraries and modules in the appropriate directories and
93with the appropriate filename extensions.
94
95<pre class=example>
96LUA_PATH=&lt;ROOT&gt;/?.lua;?.lua
97LUA_CPATH=&lt;ROOT&gt;/?.dll;?.dll
98</pre>
99
100<p> Again, naturally, in Unix the shared library extension would be
101<tt>.so</tt> instead of <tt>.dll</tt> and on Mac OS X they would be
102<tt>.dylib</tt></p>
103
104<h3>Using LuaSocket</h3>
105
106<p> With the above setup, and an interpreter with shared library support,
107it should be easy to use LuaSocket. Just fire the interpreter and use the
108<tt>require</tt> function to gain access to whatever module you need:</p>
109
110<pre class=example>
111Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
112&gt; socket = require("socket")
113&gt; print(socket.VERSION)
114--&gt; LuaSocket 2.0 (beta3)
115</pre>
116
117<p> Each module loads their dependencies automatically, so you only need to
118load the modues you are directly dependent upon. <p>
119
120<pre class=example>
121Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
122&gt; http = require("socket.http")
123&gt; print(http.get("http://www.tecgraf.puc-rio.br/luasocket"))
124--&gt; homepage gets dumped to terminal
125</pre>
126
127<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
128
129<div class=footer>
130<hr>
131<center>
132<p class=bar>
133<a href="home.html">home</a> &middot;
134<a href="home.html#down">download</a> &middot;
135<a href="instalation.html">instalation</a> &middot;
136<a href="introduction.html">introduction</a> &middot;
137<a href="reference.html">reference</a>
138</p>
139<p>
140<small>
141Last modified by Diego Nehab on <br>
142Thu Jun 17 02:47:21 EDT 2004
143</small>
144</p>
145</center>
146</div>
147
148</body>
149</html>
diff --git a/doc/introduction.html b/doc/introduction.html
index 20c4d36..a285b81 100644
--- a/doc/introduction.html
+++ b/doc/introduction.html
@@ -4,7 +4,8 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: Introduction to the core"> 6<meta name="description" content="LuaSocket: Introduction to the core">
7<meta name="keywords" content="Lua, Library, TCP, UDP, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network,
8Library, Support">
8<title>LuaSocket: Introduction to the core</title> 9<title>LuaSocket: Introduction to the core</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 10<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 11</head>
@@ -26,6 +27,7 @@
26<p class=bar> 27<p class=bar>
27<a href="home.html">home</a> &middot; 28<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 29<a href="home.html#download">download</a> &middot;
30<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 31<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 32<a href="reference.html">reference</a>
31</p> 33</p>
@@ -104,29 +106,6 @@ Together, these changes make network programming in LuaSocket much simpler
104than it is in C, as the following sections will show. 106than it is in C, as the following sections will show.
105</p> 107</p>
106 108
107<!-- initializing +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
108
109<h3>Initializing the library</h3>
110
111<p>
112The core LuaSocket is almost entirely implemented in C. It is
113usually available as a dynamic library which the interpreter can load
114with the help of a loader module written in Lua.
115Beginning with version 2.0 and following the Lua 5.0 trend, all LuaSocket
116functionality is defined inside tables (or rather namespaces). No global
117variables are ever created.
118Namespaces are obtained with the <tt>require</tt> Lua function, which loads
119and initializes any required library and returns the namespace.
120For example, the core functionality or LuaSocket is usually available
121from the "<tt>socket</tt>" namespace.
122</p>
123
124<pre class="example">
125socket = require("socket")
126print(socket.VERSION)
127--&gt; LuaSocket 2.0
128</pre>
129
130<!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 109<!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
131 110
132<h3 id=tcp>TCP</h3> 111<h3 id=tcp>TCP</h3>
@@ -318,6 +297,17 @@ io.write(socket.try((udp:receive())))
318</pre> 297</pre>
319</blockquote> 298</blockquote>
320 299
300<!-- More +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
301
302<h3 id=more>Much more</h3>
303
304<p> LuaSocket offers much more than TCP and UDP support. As the library
305evolved, support for <a href=http.html>HTTP</a>, <a href=ftp.html>FTP</a>,
306<a href=smtp.html>SMTP</a>, <a href=mime.html>MIME</a>, <a
307href=url.html>URLs</a> and much more was made available.</a> These are
308mostly implemented in Lua itself, with critical parts implemented in C for
309efficiency</p>
310
321<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 311<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
322 312
323<div class=footer> 313<div class=footer>
@@ -326,6 +316,7 @@ io.write(socket.try((udp:receive())))
326<p class=bar> 316<p class=bar>
327<a href="home.html">home</a> &middot; 317<a href="home.html">home</a> &middot;
328<a href="home.html#down">download</a> &middot; 318<a href="home.html#down">download</a> &middot;
319<a href="instalation.html">instalation</a> &middot;
329<a href="introduction.html">introduction</a> &middot; 320<a href="introduction.html">introduction</a> &middot;
330<a href="reference.html">reference</a> 321<a href="reference.html">reference</a>
331</p> 322</p>
diff --git a/doc/ltn12.html b/doc/ltn12.html
index 40dcf96..4b8f188 100644
--- a/doc/ltn12.html
+++ b/doc/ltn12.html
@@ -4,8 +4,8 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: LTN12 support"> 6<meta name="description" content="LuaSocket: LTN12 support">
7<meta name="keywords" content="Lua, Library, Filters, Source, Sink, 7<meta name="keywords" content="Lua, LuaSocket, Filters, Source, Sink,
8Pump, Support"> 8Pump, Support, Library">
9<title>LuaSocket: LTN12 module</title> 9<title>LuaSocket: LTN12 module</title>
10<link rel="stylesheet" href="reference.css" type="text/css"> 10<link rel="stylesheet" href="reference.css" type="text/css">
11</head> 11</head>
@@ -27,6 +27,7 @@ Pump, Support">
27<p class=bar> 27<p class=bar>
28<a href="home.html">home</a> &middot; 28<a href="home.html">home</a> &middot;
29<a href="home.html#download">download</a> &middot; 29<a href="home.html#download">download</a> &middot;
30<a href="instalation.html">instalation</a> &middot;
30<a href="introduction.html">introduction</a> &middot; 31<a href="introduction.html">introduction</a> &middot;
31<a href="reference.html">reference</a> 32<a href="reference.html">reference</a>
32</p> 33</p>
@@ -412,6 +413,7 @@ Creates and returns a source that produces the contents of a
412<p class=bar> 413<p class=bar>
413<a href="home.html">home</a> &middot; 414<a href="home.html">home</a> &middot;
414<a href="home.html#down">download</a> &middot; 415<a href="home.html#down">download</a> &middot;
416<a href="instalation.html">instalation</a> &middot;
415<a href="introduction.html">introduction</a> &middot; 417<a href="introduction.html">introduction</a> &middot;
416<a href="reference.html">reference</a> 418<a href="reference.html">reference</a>
417</p> 419</p>
diff --git a/doc/mime.html b/doc/mime.html
index 6758a4b..594d749 100644
--- a/doc/mime.html
+++ b/doc/mime.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: MIME support"> 6<meta name="description" content="LuaSocket: MIME support">
7<meta name="keywords" content="Lua, Library, MIME, Support"> 7<meta name="keywords" content="Lua, LuaSocket, MIME, Library, Support">
8<title>LuaSocket: MIME module</title> 8<title>LuaSocket: MIME module</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -458,6 +459,7 @@ marker.
458<p class=bar> 459<p class=bar>
459<a href="home.html">home</a> &middot; 460<a href="home.html">home</a> &middot;
460<a href="home.html#down">download</a> &middot; 461<a href="home.html#down">download</a> &middot;
462<a href="instalation.html">instalation</a> &middot;
461<a href="introduction.html">introduction</a> &middot; 463<a href="introduction.html">introduction</a> &middot;
462<a href="reference.html">reference</a> 464<a href="reference.html">reference</a>
463</p> 465</p>
diff --git a/doc/reference.html b/doc/reference.html
index 744da58..b15a2aa 100644
--- a/doc/reference.html
+++ b/doc/reference.html
@@ -4,7 +4,8 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: Index to reference manual"> 6<meta name="description" content="LuaSocket: Index to reference manual">
7<meta name="keywords" content="Lua, Library, Index, Manual, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, Index, Manual, Network, Library,
8Support, Manual">
8<title>LuaSocket: Index to reference manual</title> 9<title>LuaSocket: Index to reference manual</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 10<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 11</head>
@@ -26,6 +27,7 @@
26<p class=bar> 27<p class=bar>
27<a href="home.html">home</a> &middot; 28<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 29<a href="home.html#download">download</a> &middot;
30<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 31<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 32<a href="reference.html">reference</a>
31</p> 33</p>
@@ -220,6 +222,7 @@
220<p class=bar> 222<p class=bar>
221<a href="home.html">home</a> &middot; 223<a href="home.html">home</a> &middot;
222<a href="home.html#down">download</a> &middot; 224<a href="home.html#down">download</a> &middot;
225<a href="instalation.html">instalation</a> &middot;
223<a href="introduction.html">introduction</a> &middot; 226<a href="introduction.html">introduction</a> &middot;
224<a href="reference.html">reference</a> 227<a href="reference.html">reference</a>
225</p> 228</p>
diff --git a/doc/smtp.html b/doc/smtp.html
index 4a9aaac..27223ae 100644
--- a/doc/smtp.html
+++ b/doc/smtp.html
@@ -4,7 +4,8 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: SMTP support"> 6<meta name="description" content="LuaSocket: SMTP support">
7<meta name="keywords" content="Lua, Library, SMTP, e-mail, MIME, Multipart, Support"> 7<meta name="keywords" content="Lua, LuaSocket, SMTP, E-Mail, MIME, Multipart,
8Library, Support">
8<title>LuaSocket: SMTP support</title> 9<title>LuaSocket: SMTP support</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 10<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 11</head>
@@ -26,6 +27,7 @@
26<p class=bar> 27<p class=bar>
27<a href="home.html">home</a> &middot; 28<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 29<a href="home.html#download">download</a> &middot;
30<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 31<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 32<a href="reference.html">reference</a>
31</p> 33</p>
@@ -394,6 +396,7 @@ r, e = smtp.send{
394<p class=bar> 396<p class=bar>
395<a href="home.html">home</a> &middot; 397<a href="home.html">home</a> &middot;
396<a href="home.html#down">download</a> &middot; 398<a href="home.html#down">download</a> &middot;
399<a href="instalation.html">instalation</a> &middot;
397<a href="introduction.html">introduction</a> &middot; 400<a href="introduction.html">introduction</a> &middot;
398<a href="reference.html">reference</a> 401<a href="reference.html">reference</a>
399</p> 402</p>
diff --git a/doc/socket.html b/doc/socket.html
index c7525eb..809c256 100644
--- a/doc/socket.html
+++ b/doc/socket.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: The core namespace"> 6<meta name="description" content="LuaSocket: The core namespace">
7<meta name="keywords" content="Lua, Library, socket, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, Socket, Network, Library, Support">
8<title>LuaSocket: The socket namespace</title> 8<title>LuaSocket: The socket namespace</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -382,6 +383,7 @@ This constant has a string describing the current LuaSocket version.
382<p class=bar> 383<p class=bar>
383<a href="home.html">home</a> &middot; 384<a href="home.html">home</a> &middot;
384<a href="home.html#down">download</a> &middot; 385<a href="home.html#down">download</a> &middot;
386<a href="instalation.html">instalation</a> &middot;
385<a href="introduction.html">introduction</a> &middot; 387<a href="introduction.html">introduction</a> &middot;
386<a href="reference.html">reference</a> 388<a href="reference.html">reference</a>
387</p> 389</p>
diff --git a/doc/tcp.html b/doc/tcp.html
index dfc2c29..57784ea 100644
--- a/doc/tcp.html
+++ b/doc/tcp.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: The TCP/IP support"> 6<meta name="description" content="LuaSocket: The TCP/IP support">
7<meta name="keywords" content="Lua, Library, socket, TCP, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, Socket, TCP, Library, Network, Support">
8<title>LuaSocket: TCP/IP support</title> 8<title>LuaSocket: TCP/IP support</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -527,6 +528,7 @@ This function returns 1.
527<p class=bar> 528<p class=bar>
528<a href="home.html">home</a> &middot; 529<a href="home.html">home</a> &middot;
529<a href="home.html#down">download</a> &middot; 530<a href="home.html#down">download</a> &middot;
531<a href="instalation.html">instalation</a> &middot;
530<a href="introduction.html">introduction</a> &middot; 532<a href="introduction.html">introduction</a> &middot;
531<a href="reference.html">reference</a> 533<a href="reference.html">reference</a>
532</p> 534</p>
diff --git a/doc/udp.html b/doc/udp.html
index b0c51f6..f712b2f 100644
--- a/doc/udp.html
+++ b/doc/udp.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: The UDP support"> 6<meta name="description" content="LuaSocket: The UDP support">
7<meta name="keywords" content="Lua, Library, socket, UDP, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, Socket, UDP, Library, Network, Support">
8<title>LuaSocket: UDP support</title> 8<title>LuaSocket: UDP support</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -398,6 +399,7 @@ imperative nature obvious.
398<p class=bar> 399<p class=bar>
399<a href="home.html">home</a> &middot; 400<a href="home.html">home</a> &middot;
400<a href="home.html#download">download</a> &middot; 401<a href="home.html#download">download</a> &middot;
402<a href="instalation.html">instalation</a> &middot;
401<a href="introduction.html">introduction</a> &middot; 403<a href="introduction.html">introduction</a> &middot;
402<a href="reference.html">reference</a> 404<a href="reference.html">reference</a>
403</p> 405</p>
diff --git a/doc/url.html b/doc/url.html
index 92acf36..5c2be65 100644
--- a/doc/url.html
+++ b/doc/url.html
@@ -4,7 +4,7 @@
4 4
5<head> 5<head>
6<meta name="description" content="LuaSocket: URL manipulation"> 6<meta name="description" content="LuaSocket: URL manipulation">
7<meta name="keywords" content="Lua, Library, URL, link, Network, Support"> 7<meta name="keywords" content="Lua, LuaSocket, URL, Library, Link, Network, Support">
8<title>LuaSocket: URL support</title> 8<title>LuaSocket: URL support</title>
9<link rel="stylesheet" href="reference.css" type="text/css"> 9<link rel="stylesheet" href="reference.css" type="text/css">
10</head> 10</head>
@@ -26,6 +26,7 @@
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="home.html#download">download</a> &middot;
29<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
30<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
31</p> 32</p>
@@ -311,6 +312,7 @@ The function returns the decoded string.
311<p class=bar> 312<p class=bar>
312<a href="home.html">home</a> &middot; 313<a href="home.html">home</a> &middot;
313<a href="home.html#down">download</a> &middot; 314<a href="home.html#down">download</a> &middot;
315<a href="instalation.html">instalation</a> &middot;
314<a href="introduction.html">introduction</a> &middot; 316<a href="introduction.html">introduction</a> &middot;
315<a href="reference.html">reference</a> 317<a href="reference.html">reference</a>
316</p> 318</p>
diff --git a/src/socket.lua b/src/socket.lua
index b3a4269..c3bbba9 100644
--- a/src/socket.lua
+++ b/src/socket.lua
@@ -7,8 +7,11 @@
7----------------------------------------------------------------------------- 7-----------------------------------------------------------------------------
8-- Declare module and import dependencies 8-- Declare module and import dependencies
9----------------------------------------------------------------------------- 9-----------------------------------------------------------------------------
10module("socket") 10local base = require("base")
11local string = require("string")
12local math = require("math")
11local socket = require("lsocket") 13local socket = require("lsocket")
14module("socket")
12 15
13----------------------------------------------------------------------------- 16-----------------------------------------------------------------------------
14-- Auxiliar functions 17-- Auxiliar functions
@@ -40,11 +43,11 @@ socket.try = socket.newtry()
40 43
41function socket.choose(table) 44function socket.choose(table)
42 return function(name, opt1, opt2) 45 return function(name, opt1, opt2)
43 if type(name) ~= "string" then 46 if base.type(name) ~= "string" then
44 name, opt1, opt2 = "default", name, opt1 47 name, opt1, opt2 = "default", name, opt1
45 end 48 end
46 local f = table[name or "nil"] 49 local f = table[name or "nil"]
47 if not f then error("unknown key (" .. tostring(name) .. ")", 3) 50 if not f then base.error("unknown key (".. base.tostring(name) ..")", 3)
48 else return f(opt1, opt2) end 51 else return f(opt1, opt2) end
49 end 52 end
50end 53end
@@ -59,7 +62,7 @@ socket.sinkt = {}
59socket.BLOCKSIZE = 2048 62socket.BLOCKSIZE = 2048
60 63
61socket.sinkt["http-chunked"] = function(sock) 64socket.sinkt["http-chunked"] = function(sock)
62 return setmetatable({ 65 return base.setmetatable({
63 getfd = function() return sock:getfd() end, 66 getfd = function() return sock:getfd() end,
64 dirty = function() return sock:dirty() end 67 dirty = function() return sock:dirty() end
65 }, { 68 }, {
@@ -72,7 +75,7 @@ socket.sinkt["http-chunked"] = function(sock)
72end 75end
73 76
74socket.sinkt["close-when-done"] = function(sock) 77socket.sinkt["close-when-done"] = function(sock)
75 return setmetatable({ 78 return base.setmetatable({
76 getfd = function() return sock:getfd() end, 79 getfd = function() return sock:getfd() end,
77 dirty = function() return sock:dirty() end 80 dirty = function() return sock:dirty() end
78 }, { 81 }, {
@@ -86,7 +89,7 @@ socket.sinkt["close-when-done"] = function(sock)
86end 89end
87 90
88socket.sinkt["keep-open"] = function(sock) 91socket.sinkt["keep-open"] = function(sock)
89 return setmetatable({ 92 return base.setmetatable({
90 getfd = function() return sock:getfd() end, 93 getfd = function() return sock:getfd() end,
91 dirty = function() return sock:dirty() end 94 dirty = function() return sock:dirty() end
92 }, { 95 }, {
@@ -102,7 +105,7 @@ socket.sinkt["default"] = socket.sinkt["keep-open"]
102socket.sink = socket.choose(socket.sinkt) 105socket.sink = socket.choose(socket.sinkt)
103 106
104socket.sourcet["by-length"] = function(sock, length) 107socket.sourcet["by-length"] = function(sock, length)
105 return setmetatable({ 108 return base.setmetatable({
106 getfd = function() return sock:getfd() end, 109 getfd = function() return sock:getfd() end,
107 dirty = function() return sock:dirty() end 110 dirty = function() return sock:dirty() end
108 }, { 111 }, {
@@ -119,7 +122,7 @@ end
119 122
120socket.sourcet["until-closed"] = function(sock) 123socket.sourcet["until-closed"] = function(sock)
121 local done 124 local done
122 return setmetatable({ 125 return base.setmetatable({
123 getfd = function() return sock:getfd() end, 126 getfd = function() return sock:getfd() end,
124 dirty = function() return sock:dirty() end 127 dirty = function() return sock:dirty() end
125 }, { 128 }, {
@@ -137,7 +140,7 @@ socket.sourcet["until-closed"] = function(sock)
137end 140end
138 141
139socket.sourcet["http-chunked"] = function(sock) 142socket.sourcet["http-chunked"] = function(sock)
140 return setmetatable({ 143 return base.setmetatable({
141 getfd = function() return sock:getfd() end, 144 getfd = function() return sock:getfd() end,
142 dirty = function() return sock:dirty() end 145 dirty = function() return sock:dirty() end
143 }, { 146 }, {
@@ -145,7 +148,7 @@ socket.sourcet["http-chunked"] = function(sock)
145 -- get chunk size, skip extention 148 -- get chunk size, skip extention
146 local line, err = sock:receive() 149 local line, err = sock:receive()
147 if err then return nil, err end 150 if err then return nil, err end
148 local size = tonumber(string.gsub(line, ";.*", ""), 16) 151 local size = base.tonumber(string.gsub(line, ";.*", ""), 16)
149 if not size then return nil, "invalid chunk size" end 152 if not size then return nil, "invalid chunk size" end
150 -- was it the last chunk? 153 -- was it the last chunk?
151 if size <= 0 then 154 if size <= 0 then
@@ -168,3 +171,5 @@ end
168socket.sourcet["default"] = socket.sourcet["until-closed"] 171socket.sourcet["default"] = socket.sourcet["until-closed"]
169 172
170socket.source = socket.choose(socket.sourcet) 173socket.source = socket.choose(socket.sourcet)
174
175base.setmetatable(socket, nil)
diff --git a/test/httptest.lua b/test/httptest.lua
index cade837..71021a4 100644
--- a/test/httptest.lua
+++ b/test/httptest.lua
@@ -23,7 +23,7 @@ http.TIMEOUT = 10
23local t = socket.gettime() 23local t = socket.gettime()
24 24
25host = host or "diego.student.princeton.edu" 25host = host or "diego.student.princeton.edu"
26proxy = proxy or "http://dell-diego.cs.princeton.edu:3128" 26proxy = proxy or "http://localhost:3128"
27prefix = prefix or "/luasocket-test" 27prefix = prefix or "/luasocket-test"
28cgiprefix = cgiprefix or "/luasocket-test-cgi" 28cgiprefix = cgiprefix or "/luasocket-test-cgi"
29index_file = "test/index.html" 29index_file = "test/index.html"