Luarocks is the most widely used Lua module management tool, and its counterpart is https://luarocks.org, a public Luarocks service. Users can either download the Lua modules they need from https://luarocks.org or upload their own Lua modules to subscribe.

However, this service does not set up a Chinese site, which means that every time users need to download or upload a Lua package, they may need to communicate with a server located far across the Pacific Ocean, which can be imagined as high latency. Especially for projects such as Apache Apisix that contain a large number of Lua-dependent modules, the time taken to pull dependencies is staggering, which greatly reduces the experience of using Luarocks.

Tributary Technology recently launched its Luarocks.cn service, which aims to speed up access to https://luarocks.org for domestic users. The service is available to all developers and is completely free. A simple configuration is required to use the service. For example, when you download a Lua module, specify https://luarocks.cn in the –server parameter to make the proxy service available. The following two commands install Apache Apisix and Kong from luarocks.cn.

$ luarocks install apisix --server https://luarocks.cn   
$ luarocks install kong --server https://luarocks.cn 

In addition, you can seamlessly use the Luarocks.cn service by modifying the Luarocks configuration files, such as ~/.luarocks/config.lua and ~/.luarocks/upload_config.lua (for download and upload, respectively).

# cat .luarocks/upload_config.lua 
rocks_servers = {
    "https://luarocks.cn"
}

# cat ~/.luarocks/upload_config.lua
key = "<Your API Key>"
server = "https://luarocks.cn" 

If you’re running a non-Linux system, run luarocks from the command line



See the above information:

Edit User: /Users/**/. Luarocks /config-5.3.lua configuration to implement the proxy configuration;