Lua requires an environment

By default, the required piece is executed in the global environment.

Each loaded user script is configured to work in the sandbox, and if the script contains the required call, it will change the global environment.

Is there any way to set this environment for the same calling script?

+5
source share
1 answer

Yes, you can replace require your own function.

prosody XMPP server does it here .

+3
source

Source: https://habr.com/ru/post/1213331/


All Articles