- API Gateway websockets
- Lambda
- DynamoDB
- DynamoDB Streams (just to demo some durability)
npm i -g wscat
- to install WebSocket cat
wscat -c wss://ws.kiostix.com/{ApiStage}
example:
wscat -c wss://ws.kiostix.com/prod
Subscribe to channel:
{"action": "subscribeChannel", "channelId": "Secret", "name": "Adam"}
Unsubscribe from channel:
{"action": "unsubscribeChannel", "channelId": "Secret"}
{"action": "sendMessage", "name": "Adam", "channelId": "General", "content": "hello world!"}
(coming soon)
Install serverless
npm install -g serverless
Set credentials in ~/.aws/credentials
, then create profile
with current aws_access_key_id and aws_secret_access_key.
Reference: https://www.serverless.com/framework/docs/providers/aws/guide/credentials/
Example:
[profile]
aws_access_key_id=xxxxxxxxxx
aws_secret_access_key=xxxxxxxxxx
Deploy
serverless deploy
Install Artillery
npm i -g artillery
Run Test
artillery run test-websocket.yml