There are more AWS SDK examples available in the AWS Doc SDK Examples
Create a websocket chat application with API Gateway
The following code example shows how to create a chat application that is served by a websocket API built on Amazon API Gateway.