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
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.