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
已回答 1 年前
  • I found out that , the issue was in the server side , the connection url was wrong when used post response in the Lambda function

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则