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

**URL:** <https://openvidu.discourse.group/t/node-client-getsession-fails-in-production-for-custom-dockerized-app-bug/1155>\
**Category:** Issues with deployment\
**Tags:** v2\
**Created:** [June 11, 2020, 10:00am UTC](https://openvidu.discourse.group/t/node-client-getsession-fails-in-production-for-custom-dockerized-app-bug/1155 "2020-06-11T10:00:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wesley\_Swanepoel](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/wesley_swanepoel/32/474_2.png) [@Wesley\_Swanepoel](https://openvidu.discourse.group/u/Wesley_Swanepoel)\
**Post date:** [June 11, 2020, 10:00am UTC](https://openvidu.discourse.group/t/node-client-getsession-fails-in-production-for-custom-dockerized-app-bug/1155/1 "2020-06-11T10:00:04Z")

</div>

**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.

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [June 11, 2020, 10:34am UTC](https://openvidu.discourse.group/t/node-client-getsession-fails-in-production-for-custom-dockerized-app-bug/1155/2 "2020-06-11T10:34:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Wesley\_Swanepoel](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/wesley_swanepoel/32/474_2.png) [@Wesley\_Swanepoel](https://openvidu.discourse.group/u/Wesley_Swanepoel)\
**Post date:** [June 11, 2020, 11:03am UTC](https://openvidu.discourse.group/t/node-client-getsession-fails-in-production-for-custom-dockerized-app-bug/1155/3 "2020-06-11T11:03:39Z")

</div>

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/

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [June 11, 2020, 11:17am UTC](https://openvidu.discourse.group/t/node-client-getsession-fails-in-production-for-custom-dockerized-app-bug/1155/4 "2020-06-11T11:17:14Z")

</div>

Already fixed with this commit: [https://github.com/OpenVidu/openvidu/commit/1c3a120e0e1411c0d4f89a4c0302f92ca3a58adb](https://github.com/OpenVidu/openvidu/commit/1c3a120e0e1411c0d4f89a4c0302f92ca3a58adb)

Available in next release.
