How to use Lua language packages in a runtime module?

Hello!
I have a small question: Is there a way to add Lua language packages and use them in runtime modules? Specifically, I want to use Lua’s socket.http package to send POST and GET requests to another server. Like, I want to be able to use the require keyword and use packages.

I tried to use it normally and it got errors; like this:

local http = require("socket.http")

Thank you!

Hi amuuu,

In general you can bundle any pure Lua module compatible with Lua 5.1 . If bundled module relies on C extension it can’t be used due to sandboxing restrictions.

Regarding HTTP request to another server, there is builtin http_server function already available to you. See docs: