amazon-chime-sdk-js: messagingSession - webSock error

Important: Please attach INFO-level logs with timestamps to the report from before the session started up until the point at which the unexpected behavior occured. For multi-participant calls, attach a log file for each participant if possible.

Meeting and attendee IDs: List the meeting and attendee IDs that the attached logs apply to.

Timeline i was trying to follow use case 34 in the readme, getting websocket error at very end at messagingSession.start();

  • <timestamp> <action>
  • <timestamp> <action> image

Describe the bug websocket error

here is my test code:

<!DOCTYPE html> <script src="aws-sdk-2.807.0.js"></script> <script src="amazon-chime-sdk.min.js"></script> <script type="text/javascript"> AWS.config.update({region: 'us-east-1', credentials: {accessKeyId: 'myAccessKeyID',secretAccessKey: 'mysecretKey'}}); console.log(AWS); console.log(ChimeSDK); const logger = new ChimeSDK.ConsoleLogger('SDK', ChimeSDK.LogLevel.INFO); var Chime = new AWS.Chime({ region: 'us-east-1' }); console.log(Chime); const endpoint = Chime.endpoint.host; console.log(endpoint); const userArn = 'arn:aws:chime:us-east-1:679313049106:app-instance/e4270a05-638f-4225-93c4-979ac6542c6e'/* The userArn */; const sessionId = ''/* The sessionId */; const configuration = new ChimeSDK.MessagingSessionConfiguration(userArn, sessionId, endpoint, Chime, AWS); const messagingSession = new ChimeSDK.DefaultMessagingSession(configuration, logger); console.log(messagingSession ); const observer = { messagingSessionDidStart: () => { console.log('Session started'); }, messagingSessionDidStartConnecting: reconnecting => { if (reconnecting) { console.log('Start reconnecting'); } else { console.log('Start connecting'); } }, messagingSessionDidStop: event => { console.log(`Closed: ${event.code} ${event.reason}`); }, messagingSessionDidReceiveMessage: message => { console.log(`Receive message type ${message.type}`); } }; messagingSession.addObserver(observer); messagingSession.start(); </script> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>chime test</title> </head> <body>

chime test

<audio style="display: none" id="meeting-audio"></audio> <button type="button" id="start-button" style="display: none;"></button> <div id="video-list"> </div> </body> </html>

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

The userId of userArn, that is “us-east-1:6c4104-605f-4a58-9c2c-359****503d” in your sample, seems the return value of amplify and cognito. However, I want to use other system than cognito to authenticate. So, I want to use the userId assigned by my system. Can I use this my system’s userId instead of cognito’s userId ?

such as

arn:aws:chime:us-east-1:AWS_ACCOUNT:app-instance/0******40-680c-4**0-a484-3c1*****9a07c/user/abcdefg

@w-okada , Yes, you should be able to by setting AppInstanceUserId to a different value when calling CreateAppInstanceUser.

@w-okada, @russliu270,

Could you please take a look how we initialize messaging session in Chime SDK Components Chat Demo The userArn have to be in specific format as described here that looks like similar to this arn:aws:chime:us-east-1:AWS_ACCOUNT:app-instance/0******40-680c-4**0-a484-3c1*****9a07c/user/us-east-1:6c41**04-605f-4a58-9c2c-359******503d Let us know if this helps!