Skip to content

Instantly share code, notes, and snippets.

@creationix
Created June 25, 2015 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creationix/b2d25456345f88f74dec to your computer and use it in GitHub Desktop.
Save creationix/b2d25456345f88f74dec to your computer and use it in GitHub Desktop.
local http = require('coro-http')
local split = require('coro-split')
coroutine.wrap(function ()
split(function ()
for i = 1, 200 do
local req, body = http.request("GET", "http://luvit.io/")
p(req.code, req.keepAlive, #body)
end
end, function ()
for i = 1, 200 do
local req, body = http.request("GET", "https://luvit.io/")
p(req.code, req.keepAlive, #body)
end
end)
p((http.request("GET", "http://luvit.io/")))
p((http.request("GET", "https://luvit.io/")))
end)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment