Cloud Development Kit

WebSocket math CDK handshake not working for me

Hi. I just started trying to connect to the MyScript server by following the instructions on this page:

http://doc.myscript.com/MyScriptCloud/3.2.0/myscript-cloud/protocols.html#websocket-protocol

After a few initial attempts, I seem to be stuck. In the developer portal, I created an application and obtained the application key 'nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn'. Then I connected a WebSocket to the url wss://cloud.myscript.com/api/v3.0/recognition/ws/math. The websocket does connect, and in the onopen method, I send the object { type: 'applicationKey', applicationKey: 'nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn' }. I am expecting to receive a challenge from MyScript's server, but at this point I don't receive anything back. Am I doing something wrong?

Thanks!


Dear John,

thank you for the update.

Feel free to contact us if you have any other question.

Best regards,

Olivier

Thanks for getting back to me. I just found the problem--I was sending my raw object ws.send(obj) instead of the stringified version ws.send(JSON.stringify(obj)). Now I get the expected hmac challenge. Sorry for the trouble.

Dear John,

thank you for contacting us.

Currently, did you set the hmac key in your request?

When you say you don't receive anything back, you do not have an error message at all? Is your firewall properly configured?

Best regards,

Olivier