Search code examples
node.jslambdatcpalexa-skills-kitjson-rpc

False timed TCP handshake when using node-json-rpc on AWS Lambda


I'm trying to make my Alexa Skill (AWS Server located in US East) communicate with a JSON RPC server (hosted in Germany). For this purpose, I'm using the npm package "node-json-rpc"(https://www.npmjs.com/package/node-json-rpc) and the alexa-sdk (https://www.npmjs.com/package/alexa-sdk).

After uploading the code to the AWS I got a 50% success rate. Initially, I couldn't track the bug but then got an idea. When there is no response the TCP handshake (SYN, SYNACK, ACK) arrives after the HTTP package and gets rejected. Although the RPC server sends a retransmission request there's no retransmit from the AWS. (All tracked with Wireshark)

I have no idea how to deal with it and hope I can get a hint here. Thanks for your responses!


Solution

  • I fixed the problem myself by setting up the skill server in Python. For me it looks like the Alexa sdk for node.js is buggy, because it isn't conform to the TCP protocol.

    By setting up the skill server in Python and using the same logic I fixed the problem and everything works perfectly now.