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
gefragt vor 5 Jahren980 Aufrufe
1 Antwort
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
beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen