API Gateway Disconnect Client from Server

0

Hello, I'm using the new websocket api and I want to manually disconnect a client from the server. According to https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html you can disconnect a client by using the @connections route. I don't see any example of how to do that though. Is that undocumented? Thanks!

Your backend service can use the following WebSocket connection HTTP requests to send a callback message to a connected client, get connection information, or disconnect the client.
CP
asked 5 years ago963 views
1 Answer
1

The documentation online doesn't have it yet, however I just skimmed through an AWS video on websockets and I found the answer! You can watch it here: https://youtu.be/3SCdzzD0PdQ?t=718 but I'll outline it below:

https://${Api}.execute-api.${AWS::Region}.amazonaws.com/${Stage}/@connections/${id}

Operation   Action
POST        Sends a message 
GET         Gets the latest connection status
DELETE      Disconnects the connection
CP
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions