How to obtain a client’s sessionId (for /connection/find API) from WebSDK

hyuk

Member
Hi,

We are using the Flashphoner WebSDK (Room API) on the client side, and we want to check if a user is connected by calling the /connection/find API from the server.
However, it seems that the sessionId required by /connection/find is different from the value returned by session.id() in the WebSDK.

Currently, the client can access its own mediaSessionId, but we cannot find a way to directly obtain the sessionId that can be passed to /connection/find.

Questions
1. Is there a way for the client (WebSDK) to directly obtain the sessionId that can be used with the /connection/find API?
2. If not, what is the recommended approach to map or obtain this value on the server side?

For reference, this is before the video was transmitted.
Thank you.
 

Max

Administrator
Staff member
Good day.
Websocket session Id is known at server side only, not at client side. So there is no way to get sessionId in WebSDK (and other SDKs) directly.
You should use REST hook /connect to get a client sessionId at custom backend. Then, you can use this sessionId in /connection/find or similar query.
Please note: your custom REST hook application should proxy any REST query to the default RoomApp and then return its response to the client when using RoomApi. Please see example in this post.
 

hyuk

Member
I am trying to connect using ssh -p 2001 admin@localhost in order to register a REST hook, but I have never set a password and the default credentials (admin / admin) do not work.

Could you please advise on the reason why the default password is not accepted and how to resolve this issue?
 

Max

Administrator
Staff member
Could you please advise on the reason why the default password is not accepted and how to resolve this issue?
On AWS instance, the instance Id is used as default admin password. Please check.
 
Top