https://github.com/flaribbit/lua-www
Inspired by justjavac/proxy-www
https://github.com/flaribbit/lua-www
Last synced: 3 months ago
JSON representation
Inspired by justjavac/proxy-www
- Host: GitHub
- URL: https://github.com/flaribbit/lua-www
- Owner: flaribbit
- Created: 2021-02-24T15:25:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-24T15:26:04.000Z (over 4 years ago)
- Last Synced: 2025-01-27T12:49:33.536Z (5 months ago)
- Language: Lua
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# lua-www
Inspired by [justjavac/proxy-www](https://github.com/justjavac/proxy-www)
```lua
local http = require "socket.http"local www = {
url = "http://www",
__index = function(self, s)
self.url = self.url.."."..s
return self
end,
get = function(self, fun)
local b, s, h = http.request(self.url)
fun({body=b, status=s, header=h})
self.url = "http://www"
end
}
setmetatable(www, www)www.baidu.com:get(function (res)
print(res.status, #res.body)
end)
```Just for fun😉