{"id":13896116,"url":"https://github.com/squeek502/coro-http-luv","last_synced_at":"2025-04-13T09:25:40.782Z","repository":{"id":52942320,"uuid":"181818672","full_name":"squeek502/coro-http-luv","owner":"squeek502","description":"coro-http from Lit converted to work with plain Lua + Luv","archived":false,"fork":false,"pushed_at":"2021-09-07T23:22:58.000Z","size":358,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T01:03:16.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squeek502.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-17T04:45:02.000Z","updated_at":"2025-03-16T09:23:37.000Z","dependencies_parsed_at":"2022-08-26T20:56:05.153Z","dependency_job_id":null,"html_url":"https://github.com/squeek502/coro-http-luv","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fcoro-http-luv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fcoro-http-luv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fcoro-http-luv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squeek502%2Fcoro-http-luv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squeek502","download_url":"https://codeload.github.com/squeek502/coro-http-luv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248690069,"owners_count":21146055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T18:02:40.233Z","updated_at":"2025-04-13T09:25:40.755Z","avatar_url":"https://github.com/squeek502.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"coro-http-luv\n=============\n\n[![CI](https://github.com/squeek502/coro-http-luv/actions/workflows/ci.yml/badge.svg)](https://github.com/squeek502/coro-http-luv/actions/workflows/ci.yml)\n\n`coro-http` from [Lit](https://github.com/luvit/lit) converted to work with plain Lua + [Luv](https://github.com/luvit/luv).\n\n## Requirements\n\n- Lua (\u003e= 5.1 or LuaJIT)\n- [Luv](https://github.com/luvit/luv)\n- (optional) for HTTPS:\n  + [lua-openssl](https://github.com/zhaozg/lua-openssl)\n  + (for PUC Lua 5.1 only) [LuaBitOp](https://luarocks.org/modules/luarocks/luabitop)\n\n## Installation\n\nVia [Luarocks](http://luarocks.org/modules/squeek502/coro-http-luv):\n```\nluarocks install coro-http-luv\n```\n\n## Changes from the Lit version\n\n- Everything is now in a `coro-http-luv` module, e.g. `http-codec` is now `require`'d as `coro-http-luv.http-codec`\n- `root_ca.dat` in `secure-socket` replaced with `root_ca.lua`, which uses a string literal for the binary data (encoded by [arbitrary-binary-string](https://github.com/squeek502/lua-arbitrary-binary-string))\n- Bitwise operations in `secure-socket` will use whatever is available (Lua 5.3 operators, 'bit32', or 'bit')\n- `require('uv')` replaced with `require('luv')`\n\n## Usage\n\n```lua\nlocal luv = require 'luv'\nlocal http = require 'coro-http-luv'\nlocal unpack = table.unpack or unpack\n\ncoroutine.wrap(function()\n  local res, data = http.request('GET', 'http://localhost/')\n\n  -- status code\n  print(res.code)\n\n  -- print headers\n  for i = 1, #res do\n    local key, value = unpack(res[i])\n    print(key, value)\n  end\n\n  -- print response body\n  print(data)\nend)()\n\n-- start the luv event loop\nluv.run()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqueek502%2Fcoro-http-luv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqueek502%2Fcoro-http-luv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqueek502%2Fcoro-http-luv/lists"}