Skip to content

postToConnection can't sign custom domain names #8

Description

@ErikEklund

Hi,

I'm trying to use your ws server for a project where I have a custom domain name attached to the API Gateway.

In aws-post-to-connection, an aws4 signed URL is created from the domainName in the context. This works fine if my API url is something like xxxxx.execute-api.my-region.amazonaws.com, but in my case domainName gets set to api.mydomain.com. This makes the call fail (InvalidTokenException, or similar).

I tried adding URL mappings for my stage, so that api.mydomain.com/prod maps to the prod stage, but that doesn't seem to help. The only way I can get it to work is to inject the "real" API url as an ENV variable, and change your code that sets the host to

host: process.env.API_URL || domainName

Is there any way to add support for custom domain names? I'm not 100% sure what's needed to make this work, but currently I have to modify the package code to get this to work properly. Any pointers appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions