- Más nuevo
- Más votos
- Más comentarios
The endpoint used in replyToMessage in provided code snippet has 'wss' prefix, which means it is a websocket endpoint. To send a message to a connected client using 'ConnectionId' of the client, 'connections' endpoint needs to be used which has 'https' protocol. Updating the endpoint protocol 'wss' as in the following snippet to 'https' may help.
const api = new ApiGatewayManagementApiClient({endpoint: 'wss://<id>.execute-api.<region>.amazonaws.com/production',
region: 'eu-central-1'
})
I think you getting this error on the client side. Is it correct? The error indicates that you are trying to connect over port 80. API Gateway only supports port 443 using wss: protocol. I am guessing this is the reason for the error.
@Uri thank you for your answer. In Postman I have a 'wss:/'/ prefix before api url. I get above mentioned error in 'replyToMessage' when I try to send message back to client.
Contenido relevante
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace un año
- ¿Cómo puedo solucionar los errores 410 GoneException con las API de WebSocket de Amazon API Gateway?OFICIAL DE AWSActualizada hace 2 años
Fixed url: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html