Does Custom Domain Work for WebSocket APIs ?

0

I created a Sample Websocket Chat App using this https://github.com/aws-samples/simple-websockets-chat-app The websocket connection is working fine.

But when I connect a API Gateway Custom Domain to this api. The connection is successfull, the messages are sent from client to server, but the messages from server are not received at the client

1개 답변
0

Hello Raghavendra,

Custom Domain is definitely supported for Websocket API. Here is a documentation you can refer to setup custom domain.

Regarding, the messages from server not being received at the websocket client, this could be due to missing route response.

WebSocket routes can be configured for two-way or one-way communication. If a route has a route response, it is configured for two-way communication. Otherwise, it is configured for one-way communication. Route responses are used to enable two-way communication, in which your API can send a response back to the client in the context of the client's message.

https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-route-response.html

https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-responses.html

AWS
지원 엔지니어
Isha_K
답변함 일 년 전
  • I found out that , the issue was in the server side , the connection url was wrong when used post response in the Lambda function

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인