Technology Sharing

Ubuntu/Openwrt using lua to send http and https requests

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

1. Ubuntu configuration to support lua sending http and https requests

1.1. Configure apt mirror source

Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 6.5.0-41-generic x86_64)

Link: https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.6c1a1b117VwAM7

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

将下面的ubuntu 22.04 LTS (jammy) 配置配置到这个源文件中
sudo mv /etc/apt/sources.list

Ubuntu 22.04 LTS (jammy) is configured as follows

deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

1.2. Install related Lua packages

sudo apt update
sudo apt install -y lua5.3
lua -v
sudo apt install -y liblua5.3-dev

sudo apt install -y luarocks
sudo luarocks install luasocket

2. Openwrt configures menuconfig to support lua sending http and https requests

2.1、Configure menuconfig

Configuration selection Languages -