roberts
Group: Members
Posts: 4983
Joined: Oct. 2003 |
|
Posted: April 04 2008,16:08 |
|
You can go low level and implement an RFC as the example that I posted.
Or you can use higher level known protocols like FTP
Here is a trivial example: (Warning this script will try to download the mydsl extension Xeyes into the current directory)
Code Sample | #!/bin/murgaLua local ftp = require("socket.ftp") file,error = ftp.get("ftp://ibiblio.org/pub/Linux/distributions/damnsmall/mydsl/apps/xeyes.info") if error == nil then io.output("xeyes.info"); io.write(file); end file,error = ftp.get("ftp://ibiblio.org/pub/Linux/distributions/damnsmall/mydsl/apps/xeyes.tar.gz.md5.txt") if error == nil then io.output("xeyes.tar.gz.md5.txt"); io.write(file); end file,error = ftp.get("ftp://ibiblio.org/pub/Linux/distributions/damnsmall/mydsl/apps/xeyes.tar.gz;type=i") if error == nil then io.output("xeyes.tar.gz"); io.write(file); end
|
|