修改 Makefile
Mac 下:
# https : turn on TLS_MODULE to add https support
TLS_MODULE=ltls
TLS_LIB="$(shell brew --prefix openssl)/lib"
TLS_INC="$(shell brew --prefix openssl)/include"
Linux 下:
# https : turn on TLS_MODULE to add https support
TLS_MODULE=ltls
TLS_LIB=
TLS_INC=
前提是都安裝了 openssl
然后在 config 里配置
certfile = "./host.cert"
keyfile = "./host.key"
用 simpleweb.lua 測試,記得先把 http 改成 https