Node-client: GetSession Fails in production for custom dockerized app (Bug?)

Background info
I followed the “On Premise” installation procedure on an Amazon Ec2 instance. Then built my Node application following the Node tutorial. I then set-up a docker compose (dockerize) for my custom app and successfully deployed this to work with the reverse proxy. However the live stream will fail upon getting a session.

The docs states: OpenVidu platform URL has to be configured to http://localhost:5443

The failure however was due to the openvidu-node-client forcing https, i.e. assuming the app server was a different server is my guess. But this doesn’t work for where the app is installed on the same server as the openvidu platform.

Changing the protocol in the Session.js file for getSessionIdHttp and generateToken resolves this issue.

My question is: Should this be https if running on the same server? Is this a problem with my deployment + environment or app? I’m not that versed in the architecture of OpenVidu.

Hi,

This is clearly a limitation in openvidu-node-client. We’ll update the library to be able to force plain HTTP for use cases as yours.
For now you can simply change the URL used by your Node app to connect to your OpenVidu Server to https://SERVER_PUBLIC_IP/

So, even the app is running in the same host as OpenVidu Server, it will simply use the public secure IP to throw REST petitions to it. This way it will work just fine. But again, we will be updating openvidu-node-client to allow using plain HTTP as OpenVidu endpoint.

Regards.

1 Like

Thanks I didn’t even think of this.

For now you can simply change the URL used by your Node app to connect to your OpenVidu Serer to https://SERVER_PUBLIC_IP/

Already fixed with this commit: https://github.com/OpenVidu/openvidu/commit/1c3a120e0e1411c0d4f89a4c0302f92ca3a58adb

Available in next release.