Google 云端点:Websockets 和 JWT

Google Cloud Endpoints: Websockets and JWT

我一直在通过 Firebase auth(z) 使用 gRPC 开发移动应用程序 (iOS)。我的服务器使用 GKE 和 NGinx 代理 - 所以现在我正在开发 Web UI 以更深入地配置用户帐户。我不想回退到 REST API's,所以我想知道 Google Cloud Endpoints 是否支持 websockets,它是否也会阻止未经授权的应用程序用户尝试发出请求?使用 websockets 我知道这是可能的,但由于我与 gRPC 和 Cloud Endpoints 捆绑在一起,我只是在回退到 REST API 调用之前进行检查(我不想这样做!)。

总结:Google Cloud Endpoints 是否支持带有来自 Firebase 的 JWT 身份验证令牌的 Websockets?

谢谢

目前,Cloud Endpoints 根本不支持 WebSockets。

顺便说一句,WebSockets 的用例是什么? WebSocket 也不适用于 gRPC。如果你只想从 Web UI 与你的 gRPC 服务对话,transcoding 应该可以。它与来自 Firebase auth 的 JWT 一起工作。

Google Cloud Endpoints ESP 不支持 websockets。

但是,Google Cloud Endpoints 已经开源了它们的 Extensible Service Proxy implementation. Internally it's implemented as a custom nginx module。由于 Nginx 支持 websockets,因此向其 nginx:esp 模块添加支持应该是可行的。

但这绝对超出了我的范围。 :-)

It looks like ESP supports websockets now,在 esp 配置中使用 "--enable_websocket" 标志。