Comments (3)
Moon不直接支持https, HTTPS需要用代理,可以看下wiki
示例
--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
from moon.
好吧
from moon.
好吧
主要原因是带上 OpenSSL 编译,会增加编译复杂度,使用nginx更加简洁高效, 并且线上环境一般都会依赖nginx。开发环境一般在内网部署一个,可以项目组共用。
from moon.
Related Issues (18)
- windows部署 HOT 1
- Lua table json decode/encode support integer key
- 求助:查询mysql遇到问题. HOT 2
- 如何调试这个工程的Lua部分? HOT 3
- 疑问:list.lua queue.size(q)的大小 HOT 1
- moon.new_service是怎么返回服务id的? HOT 3
- mooncore这个lua文件在哪里呀? HOT 3
- 大佬,vs2015无法编译,帮忙兼容一下 HOT 1
- vs2022编译最新版本代码失败,mimalloc(看着是2017版编译的)解析失败了。 HOT 2
- navmesh.hpp recast方法最后没有对hitPos进行处理 HOT 1
- 编译报错
- lua-json添加选项: 数组是稀疏数组时, encode table为 json object
- VS2022 17.5+ build error about stdatomic.h
- 请问 lua_service::dispatch 中调用的是什么函数,没看出来哪里推入栈的 HOT 2
- 升级代码后,之前版本正常。 HOT 17
- uuid库,会生成重复的id HOT 27
- mysql接口会导致服务器cpu利用率飙升,到99% HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moon.