title: Why doesn't my API Gateway WebSocket send responses with custom domain name configured?
body: <p>I've configured a WebSocket API with API Gateway and am trying to get a custom domain name configured for it. It's a very simple API that sends messages between connected clients, which stores connection IDs in DynamoDB. In essence, it is similar to the example demonstrated here: <a href="https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/" rel="noreferrer">https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/</a></p>
  
  <p>All works fine when using the AWS-generated URL i.e. wss://.execute-api.us-west-2.amazonaws.com/. However, when I follow <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-regional-api-custom-domain-create.html" rel="noreferrer">these instructions</a> from AWS to set up a custom regional domain name, I am able to connect but am unable to send messages between clients.</p>
  
  <p>I've checked the Cloudwatch logs for my Lambda functions and don't see any errors and have tried launching an entirely new environment using my CloudFormation template to no avail.</p>
  
  <p>To be very clear, the following connection command triggers my Lambda function correctly and connects my client using the AWS-generated URL AND my own in Route 53.</p>
  
  <pre><code>wscat -c wss://&lt;endpoint&gt; &lt;payload&gt;
  </code></pre>
  
  <p>The following command, which sends a message to connected clients, works using the AWS-generated URL but NOT my own.</p>
  
  <pre><code>{ "message": "sendMessage", "toId": "193818", "data", "a random msg" }
  </code></pre>