LuaSocket is a Lua extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for functionality commonly needed by applications that deal with the Internet.
The core support has been implemented so that it is both efficient and simple to use. It is available to any Lua application once it has been properly initialized by the interpreter in use. The code has been tested and runs well on several Windows and Unix platforms.
Among the support modules, the most commonly used implement the SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading files) client protocols. These provide a very natural and generic interface to the functionality defined by each protocol. In addition, you will find that the MIME (common encodings), URL (anything you could possible want to do with one) and LTN12 (filters, sinks, sources and pumps) modules can be very handy.
[b]Download[b]
Get it here: http://www.autoplaymediastudio.com/d...luasocket.html
Installation
Here is how to make the LuaSocket Lua module available to your AutoPlay Media Studio 8 project.
1. Download the Lua module and extract it to a temporary location.
2. Copy the contents of the "lua" folder to your project's Scripts folder. (Do not place it in a lua subfolder; put it directly inside the Scripts folder.)
3. Copy the "mime" folder to you project's Scripts folder.
4. Copy "core.dll" from the socket folder into the existing "socket" folder in your project's Scripts folder.
5. Add the following requires to your project, e.g. in Global Functions or where they will be used:
Usage
The functions are documented here:
Example
Credits
Copyright 2004-2007 Diego Nehab. All rights reserved.
LuaSocket is free software and uses the same license as Lua.
The core support has been implemented so that it is both efficient and simple to use. It is available to any Lua application once it has been properly initialized by the interpreter in use. The code has been tested and runs well on several Windows and Unix platforms.
Among the support modules, the most commonly used implement the SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading files) client protocols. These provide a very natural and generic interface to the functionality defined by each protocol. In addition, you will find that the MIME (common encodings), URL (anything you could possible want to do with one) and LTN12 (filters, sinks, sources and pumps) modules can be very handy.
[b]Download[b]
Get it here: http://www.autoplaymediastudio.com/d...luasocket.html
Installation
Here is how to make the LuaSocket Lua module available to your AutoPlay Media Studio 8 project.
1. Download the Lua module and extract it to a temporary location.
2. Copy the contents of the "lua" folder to your project's Scripts folder. (Do not place it in a lua subfolder; put it directly inside the Scripts folder.)
3. Copy the "mime" folder to you project's Scripts folder.
4. Copy "core.dll" from the socket folder into the existing "socket" folder in your project's Scripts folder.
5. Add the following requires to your project, e.g. in Global Functions or where they will be used:
Code:
-- for the ftp functions ftp = require("socket.ftp") -- for LTN012 filters sources and sinks ltn12 = require("ltn12") -- for the http functions http = require("socket.http") -- for filters that apply and remove common content transfer encodings mime = require("mime") -- for functionality to send e-mail messages smtp = require("socket.smtp") -- for the core functionality of LuaSocket socket = require("socket") -- for functions to parse, protect, and build URLs, as well -- as functions to compose absolute URLs from base and relative URLs url = require("socket.url")
The functions are documented here:
Example
Code:
-- Show the debug window. Debug.ShowWindow(true); -- Print the socket version to the debug window. socket = require("socket") Debug.Print("Socket Version: "..socket._VERSION.."\r\n\r\n"); -- Print the html source of the URL to the debug window. http = require("socket.http") strWebSource = http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"); Debug.Print(strWebSource);
Copyright 2004-2007 Diego Nehab. All rights reserved.
LuaSocket is free software and uses the same license as Lua.
Comment