We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用httpc.get访问https接口,看表现是会用http访问。
The text was updated successfully, but these errors were encountered:
Moon不直接支持https, HTTPS需要用代理,可以看下wiki
https://github.com/sniper00/moon/wiki/Http#httpclient-http%E8%BD%AChttps%E6%AD%A3%E5%90%91%E4%BB%A3%E7%90%86%E9%85%8D%E7%BD%AE
示例
--httpsGoogle登录令牌认证 local function GoogleTokenVerify(token, userId) local url = string.format("https://oauth2.googleapis.com") local response = httpc.get(url, { path = string.format("/tokeninfo?id_token=%s", token), proxy = "http://127.0.0.1:8443" -- 这里设置nginx http->https 正向代理 }) if response == nil or response.status_code ~= 200 or response.content == nil then return 1 end local jsonStr = json.decode(response.content) if jsonStr == nil then return 2 end if jsonStr["sub"] == nil or jsonStr["sub"] ~= userId then return 3 end return 0 end
Sorry, something went wrong.
好吧
主要原因是带上 OpenSSL 编译,会增加编译复杂度,使用nginx更加简洁高效, 并且线上环境一般都会依赖nginx。开发环境一般在内网部署一个,可以项目组共用。
No branches or pull requests
使用httpc.get访问https接口,看表现是会用http访问。
The text was updated successfully, but these errors were encountered: