{"id":15140857,"url":"https://github.com/monk-afk/httptest","last_synced_at":"2026-02-21T09:31:46.668Z","repository":{"id":242564845,"uuid":"809888451","full_name":"monk-afk/httptest","owner":"monk-afk","description":"A Generic HTTP-based IPC bridge for Minetest.","archived":false,"fork":false,"pushed_at":"2025-06-16T00:53:37.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T17:43:46.377Z","etag":null,"topics":["apache2","lua","minetest"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monk-afk.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-03T16:34:54.000Z","updated_at":"2025-06-16T00:53:41.000Z","dependencies_parsed_at":"2025-10-25T17:36:14.822Z","dependency_job_id":null,"html_url":"https://github.com/monk-afk/httptest","commit_stats":null,"previous_names":["monk-afk/httptest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/monk-afk/httptest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monk-afk%2Fhttptest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monk-afk%2Fhttptest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monk-afk%2Fhttptest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monk-afk%2Fhttptest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monk-afk","download_url":"https://codeload.github.com/monk-afk/httptest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monk-afk%2Fhttptest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29678228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["apache2","lua","minetest"],"created_at":"2024-09-26T08:41:57.061Z","updated_at":"2026-02-21T09:31:46.635Z","avatar_url":"https://github.com/monk-afk.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"HTTPTEST\n--------\n\nA Generic HTTP-based IPC bridge for Minetest.\n\nMIT (c) 2024 monk\n\n\u003e The HTTP server and language used server-side in this document is for Apache2's mod_lua. It can be switched out for any other setup.\n\n___\n\nFor Apache httpd version 2.3 or later. It is highly recommend to use latest version with patch, which added support for Lua 5.4, and contains rather important [Security patches](https://downloads.apache.org/httpd/CHANGES_2.4).\n\n \u003e [!WARNING]\n \u003e It is not recommended that you use this module on a server that is shared with users you do not trust, as it can be abused to change the internal workings of httpd.\n\nThis package currently contains the bare minimum required to demonstrate functionality.\n\n___\n\n### sites-enabled\n\nInclude the following VirtualHost directives to an enabled site, by default it is 000-default.conf.\n\n```conf\n  LoadModule lua_module modules/mod_lua.so\n  \u003cFiles \"*.lua\"\u003e\n      SetHandler lua-script\n  \u003c/Files\u003e\n```\n___\n\n### www/html\n\nAdd index.lua to the http document root folder. This is defaulted to /var/www/html/ in Debian. Below are two options:\n\n```lua\n-- Option 1:\n--[[ Formatted 'data' field (see screenshot).\n      Not compatible with web browser. ]]\n  require \"string\"\n  function handle(r)\n    r.content_type = \"text/plain\"\n    if r.method == 'GET' then\n      r:puts('return{',\n        'Date = \"'..os.date(\"%x %X\",r:clock())..'\",',\n        'Host = \"'..r.server_name..' '..r.banner..'\",',\n        'Received = \"'..r.protocol..' '..r.content_type..'\",',\n        'ReplyTo = \"'..r:headers_in_table().Name..'@'..r.useragent_ip..':'..r.port..'\",',\n        'UserAgent = \"'..r:headers_in_table()[\"User-Agent\"]..'\",',\n        'UserData = \"'..r:headers_in_table().Userdata:gsub(\"\\\"\",\"\\\\\\\"\")..'\"}'\n      )\n      return apache2.OK\n    end\n  end\n```\n```lua\n-- Option 2:\n--[[ Unformatted 'data' field, compatible with browser. ]]\nfunction handle(r)\n  r.content_type = \"text/html\"\n  if r.method == 'GET' then\n    for i, n in pairs(r:headers_in_table()) do\n      r:puts(i..\"-\u003e \".. n..\"\\n\")\n    end\n  end\n  r:puts(\"Hi Minetest, from Apache2\")\n  return apache2.OK\nend\n```\n\nMany example functions for mod_lua can be found in the docs linked at the end of this readme.\n\n___\n\n### mod_lua\n\nEnable the Lua module for Apache2:\n\n```bash\n$ sudo /usr/sbin/a2enmod lua\n\nEnabling module lua.\nTo activate the new configuration, you need to run:\n  systemctl restart apache2\n```\n\nStart or restart Apache to apply the configurations\n\n___\n\n### minetest.conf\n\nInclude within your minetest.conf:\n\n```conf\nsecure.http_mods = httptest\napache2_url = http://127.0.0.1:80/index.lua\n```\n\n___\n\n### httptest\n\nAdd httptest folder to your mods or worldmods folder, start Minetest server.\n\nThe chatcommand `/apache [text]` sends an HTTP request to Apache httpd, and the reply is presented on-screen in formspec:\n\n![screenshot of the content headers of httpd reply from minetestserver](screenshot.png)\n\nCongratulations! You now have a bridge connecting a Minetest server to an Apache HTTP server.\n\n___\n\n### Documentation\n\n- \u003e [Apache Module mod_lua](https://httpd.apache.org/docs/trunk/mod/mod_lua.html)\n\n- \u003e [Hook Functions in the Apache HTTP Server 2.x](https://httpd.apache.org/docs/trunk/developer/hooks.html)\n\n- \u003e [Creating hooks and scripts with mod_lua](https://httpd.apache.org/docs/trunk/developer/lua.html)\n\n\n- \u003e [HTTP Request definition](https://github.com/minetest/minetest/blob/master/doc/lua_api.md#httprequest-definition)\n\n- \u003e [HTTPRequestResult definition](https://github.com/minetest/minetest/blob/master/doc/lua_api.md#httprequestresult-definition)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonk-afk%2Fhttptest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonk-afk%2Fhttptest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonk-afk%2Fhttptest/lists"}