Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket close connection with error code #2060

Open
naomiven opened this issue Jul 21, 2023 · 0 comments
Open

websocket close connection with error code #2060

naomiven opened this issue Jul 21, 2023 · 0 comments

Comments

@naomiven
Copy link

naomiven commented Jul 21, 2023

in WebsocketAPI can we have a method that closes a websocket connection with a specified code?

similar to this

according to the websocket protocol we should be able to do this -> spec

right now, in API gateway logs, the connection is always closed with status code 1000 when calling the existing close method:

app.websocket_api.close(event.connection_id)

API gateway logs:

Endpoint request body after transformations: 
...
        {
          "routeKey": "$disconnect",
          "disconnectStatusCode": 1000,
          "authorizer": {
              "principalId": "user"
        },
        "eventType": "DISCONNECT",
        "requestTime": "20/Jul/2023:23:29:25 +0000",
        "messageDirection": "IN",
        "disconnectReason": "Connection Closed Normally",
        "connectedAt": 1689895754759,
        "requestTimeEpoch": 1689895765983,
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant