By using AWS re:Post, you agree to the Terms of Use

API Gateway Sockets and CORS


As per the title, how does one enable CORS on an API Gateway Socket?

Notoriously,, since v3, requires the socket endpoint to have CORS enabled.

I have tried adding headers to the return response in my Lambda (see below), but that does not seem to work.

return { statusCode: 200, body: 'Connected', headers: {'Access-Control-Allow-Origin': '*'} };