$ tf apply
$ uv run -m scripts.client --with websockets --url $(tf output -raw websocket_api_endpoint)
$ tf destroy
export API_URL=$(tf output -raw websocket_api_endpoint)
uv run scripts/test_websocket.py
uv run scripts/test_recv.py# view websocket connect logs
uv run --with zmunk-awslogs -m awslogs $(tf output -raw websocket_connect_lambda_log_group)
# view websocket disconnect logs
uv run --with zmunk-awslogs -m awslogs $(tf output -raw websocket_disconnect_lambda_log_group)
# view websocket sendmessage logs
uv run --with zmunk-awslogs -m awslogs $(tf output -raw websocket_sendmessage_lambda_log_group)Note: If sender is None, user is anonymous.
{
"type": "user_message",
"body": {
"message": "Hello, friend.",
"sender": "Elliot",
"sender_id": 1234
}
}{
"type": "server_message",
"body": {
"message": "Elliot has entered the chat."
}
}Note: "action": "sendmessage" needs to always be included in the object.
Sending message
{
"type": "message",
"body": {
"message": "Hello, friend."
}
}Updating username:
{
"type": "set_username",
"body": {
"username": "Elliot"
}
}