Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Simple LUA socket connection
- Checks a webserver (host) for a file
- Then prompts port 80 with a request for the file
- File downloads
- ]]
- require "luasocket" --Much like the #include in C
- host = "www.caustik.heliohost.org" --Specifiying the host
- file = "/filepack/ElephantArchive.zip"--Choosing the file
- c = assert(socket.connect(host, 80))--Connecting to the apache port
- c:send("GET " .. file .. " HTTP/1.0\r\n\r\n")--Requesting the file
- c:close()--Closing the connection
Add Comment
Please, Sign In to add comment