Is it possible to use Socket.io with AWS Lambda?

后端 未结 8 1459
深忆病人
深忆病人 2021-01-30 01:31

Is it possible to build a function in AWS Lambda that creates a websocket and send data to subscribed applications?

Something like this:

John has the app SuperPh

8条回答
  •  情歌与酒
    2021-01-30 02:19

    No! Lambda was not designed for socket.io. Lambda was designed for short-time processing only.

    If you want to provide cheap notifications, you can try external services like PubNub or Realtime Framework.

    If you want to stay using only Amazon services, don't bother trying SNS because it won't serve for this use case (there isn't an endpoint for browsers).

    However, you can try AWS IoT. I know that it sounds strange, but since it supports browsers through MQTT, it's a great tool for cheap, fast and easy to develop notifications. Follow this link for a great tutorial. Demo code is available here.

提交回复
热议问题