Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

Setup Infrastructure

$ tf apply

Run Client

$ uv run -m scripts.client --with websockets --url $(tf output -raw websocket_api_endpoint)

Teardown Infrastructure

$ tf destroy

Debugging

Testing websocket

export API_URL=$(tf output -raw websocket_api_endpoint)
uv run scripts/test_websocket.py
uv run scripts/test_recv.py

View lambda logs

# 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)

Websocket Dialog Documentation

Receiving user message from server

Note: If sender is None, user is anonymous.

{
    "type": "user_message",
    "body": {
        "message": "Hello, friend.",
        "sender": "Elliot",
        "sender_id": 1234
    }
}

Receiving server message

{
    "type": "server_message",
    "body": {
        "message": "Elliot has entered the chat."
    }
}

Sending data to server

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"
    }
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages