Websockets with custom domain

Is it possible to use a custom domain with a WebSocket gateway in AWS? I’ve successfully deployed multiple REST services with a custom domain but that method doesn’t appear to work for WebSockets and I’ve not been able to find anything to point me in the right direction.

The serverless-domain-manager plugin doesn’t seem to work as it only seems to be able to connect to REST services. If I try it with a WebSocket only service then I get the following error

Error: Failed to find CloudFormation resources for <domain>

Enabling debug narrows it down to

ValidationError: Resource ApiGatewayRestApi does not exist for stack <stack>

I can’t see anything in the plugin docs that mention WebSockets so I assume it’s not supported?

Is there another way of using a custom domain for WebSockets?

EDIT: I should add that if I remove the custom domain parts it deploys fine to an AWS url.


1 Like

Hi, have you found the solution to this?

Hi I am also looking for a solution for this. It doesn’t look like serverless supports custom domain names for websockets

The custom domain manager plugin also doesn’t support it.

Has anyone found a work around?