I have a simple Node.js 10.x Lambda function that works fine when tested on the Lambda function console:
exports.handler = async (event) => {
var msg = 'connected';
return {
statusCode: 200,
body: { msg: msg}
};
};
I created a WebSocket API through their API Gateway console, that integrates to it through a LAMBDA_PROXY
integration:
When I try to connect to it using wscat, I get an error:
wscat -c "wss://awesomeid1.execute-api.us-west-2.amazonaws.com/dev"
error: Unexpected server response: 502
How can I fix it?
Bonus question: how can we find the logs for the Websocket API connection errors?
Related links that didn't help me to fix it: