Add HTTPS Lua module.

It can be loaded via https = require("https").
Basic API is responsecode, body = https.request(url).
Slightly more advanced API is responsecode, body, headers = https.request(url, {method="post" or "get", data=str, headers={}}).
This commit is contained in:
Alex Szpakowski
2022-01-30 13:21:33 -04:00
parent f4a85f42df
commit d7522c88af
29 changed files with 2229 additions and 3 deletions
+7
View File
@@ -173,6 +173,10 @@ extern "C"
extern int luaopen_love_arg(lua_State*);
extern int luaopen_love_callbacks(lua_State*);
extern int luaopen_love_boot(lua_State*);
#ifdef LOVE_ENABLE_LUAHTTPS
extern int luaopen_https(lua_State*);
#endif
}
static const luaL_Reg modules[] = {
@@ -656,6 +660,9 @@ int luaopen_love(lua_State *L)
#ifdef LOVE_ENABLE_LUA53
love::luax_preload(L, luaopen_luautf8, "utf8");
#endif
#ifdef LOVE_ENABLE_LUAHTTPS
love::luax_preload(L, luaopen_https, "https");
#endif
#ifdef LOVE_ENABLE_WINDOW
// In some environments, LuaJIT is limited to 2GB and LuaJIT sometimes panic when it