Node create session getSessionId() always return "localhost"

484 views
Skip to first unread message

Miguel Rodríguez Crespo

unread,
Mar 19, 2018, 12:03:47 PM3/19/18
to OpenVidu
I have a node server to create session tokens. When I create a session, this session has the ip of the openvidu-server-kms docker image vps. But when `mySession.getSessionId` is executed, this always returns an sessionId with localhost instead of my vps server ip.

What could I'm doing wrong?

Miguel Rodríguez Crespo

unread,
Mar 19, 2018, 12:12:07 PM3/19/18
to OpenVidu
And yes, I launched the docker image with -e openvidu.publicurl=https://<vps_ip>:8443
Message has been deleted

Miguel Rodríguez Crespo

unread,
Mar 20, 2018, 5:11:27 AM3/20/18
to OpenVidu
I've been looking in the docker logs, and I've seen that although when I launch the image I set the openvidu.publicurl pointing to the ip of the vps in which I launched the image, the following logs appear in the logs:


In addition, I have tried to launch the java project, and in this case the openvidu.publicurl is set correctly. I am almost sure that the problem is only in the case of being a docker image. 
Can you check it please?

Miguel Rodríguez Crespo

unread,
Mar 20, 2018, 6:20:54 AM3/20/18
to OpenVidu
I found the problem I think. In supervisord.conf file (openvidu-server/docker/openvidu-server-kms directory) the openvidu.publicurl is always set to docker-local (-Dopenvidu.publicurl=docker-local), so openvidu.publicurl is useless at this moment. Could you check this is correct?

aardbol...@gmail.com

unread,
Mar 22, 2018, 4:29:00 AM3/22/18
to OpenVidu
I have the same issue when using the latest openvidu docker version.
Best regards,


Op maandag 19 maart 2018 17:03:47 UTC+1 schreef Miguel Rodríguez Crespo:

Pablo

unread,
Mar 22, 2018, 4:41:44 AM3/22/18
to OpenVidu
You are totally right. There's a bug in the configuration of the Docker image openvidu-server-kms for versions 1.8.0 and 1.9.0-beta-1. Will be fixed by tomorow or next week at the latest.

De...@ottstreamingvideo.net

unread,
Mar 27, 2018, 1:09:53 AM3/27/18
to OpenVidu
Hello Pablo,

It looks like the same issue applies to https://hub.docker.com/r/openvidu/openvidu-server/.

When the webpage is on a different server from the Coturn, KMS and OpenVidu server, the REST API on http://openvidu.io/docs/reference-docs/openvidu-browser/ returns a sessionId such as wss://localhost:8443/bsqh1wfctrn4pq6c, which causes an error "The user is not authorized. Code: 401" when attempting to get a token via the REST API.

There does not seem to be a way to set the -e kms.uris=[\"ws://example.com:8888/kurento\"] parameter.

KMS 6.7.1 was installed via http://doc-kurento.readthedocs.io/en/stable/user/installation.html.

OpenVidu was installed via docker (https://hub.docker.com/r/openvidu/openvidu-server/), and the https://example.com:8443/ frontend works fine with a SSL certificate from Letsencrypt.

Thanks for your help.

Dean

De...@ottstreamingvideo.net

unread,
Mar 27, 2018, 1:05:14 PM3/27/18
to OpenVidu
Hello Pablo,

I just pulled the latest docker opendidu-server at about Tue Mar 27 16:45:35 UTC 2018 and it runs with Coturn, KMS, and the docker openvidu-server on one Ubuntu-16.04 server and the web application using the REST API on a different Ubuntu-16.04 server. The sessionId now comes back as wss://example.com:8443/fecgjdfx1btp9i5v so the token can be obtained via the REST API and the user can join the session.

This was confirmed on Chrome on Ubuntu-16.04 and Firefox on Windows-8.1.

On an iPad running Safari on iOS 11.2.6 (15D100) the user can join the session but the video streams are not displaying, so I will take a close look at that. The local stream is not showing at all, and the two remote streams are black rectangles.

The JavaScript file is openvidu-browser-1.9.0-beta-1.js.

Thanks,

Dean

On Monday, March 19, 2018 at 9:03:47 AM UTC-7, Miguel Rodríguez Crespo wrote:

Pablo

unread,
Mar 28, 2018, 4:13:23 AM3/28/18
to OpenVidu
Hi,

OpenVidu Documentation page has just been updated with a new 'Releases' section: http://openvidu.io/docs/releases
This section is intended to explain the new features and fixes for each new release, as well as any changes needed to use it.

The artifact table will also be appended for each release. This should help clear up any doubts about compatibility between artifacts.

Regarding version 1.9.0-beta-1, to make it compatible with Safari it is a mandatory requirement to install Kurento Media Server 6.7.0. This is all explained in that section.

De...@ottstreamingvideo.net

unread,
Mar 28, 2018, 6:52:09 PM3/28/18
to OpenVidu
Hello Pablo,

Thank you for the updated information.

Question 1. Is there a specific adapter.js that should be used with openvidu-browser-1.9.0-beta-1.js?

Question 2. Is it possible that the openvidu-browser-1.9.0-beta-1.js (http://openvidu.io/docs/reference-docs/openvidu-browser/) and REST API (http://openvidu.io/docs/reference-docs/REST-API/) method is not yet Safari compatible?

Background

kurento-media-server 6.7.0 was installed after removing 6.7.1 using "sudo apt-get purge --auto-remove kurento-media-server" and changing /etc/apt/sources.list.d/kurento.list for 6.7.0.

After installing kurento-media-server 6.7.0 per http://openvidu.io/docs/releases/, it was necessary to add two parameters into /etc/sysctl.conf (Ubuntu-16.04) in order for the websocket to operate on port 8888:

net.ipv4.tcp_max_syn_backlog=1024
net.ipv4.tcp_syncookies = 1

This information was found in https://stackoverflow.com/questions/48557856/ufw-not-allowing-kurento-media-server-6-7-to-get-connected-through-ws-uri (this was not necessary for kurento-media-server 6.7.1).

All docker instances were stopped and removed via:

docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -a | grep openvidu)

The latest docker "openvidu/openvidu-server" was then started using (my domain replaces example.com and my secret replaces my_secret):

sudo docker run -d -p 8443:8443 -v /etc/letsencrypt/live/example.com/p12keystore.p12:/etc/letsencrypt/live/example.com/p12keystore.p12:ro -e openvidu.secret="my_secret" -e openvidu.publicurl="https://example.com:8443/" -e server.ssl.key-store=/etc/letsencrypt/live/example.com/p12keystore.p12 -e server.ssl.key-store-password=openvidu -e server.ssl.key-alias=openvidu-selfsigned --net="host" openvidu/openvidu-server

WARNING: Published ports are discarded when using host network mode
18d...

docker container logs 18d show no errors.

https://example.com:8443/ runs the openvidu front end.

My REST API based web applications runs in Firefox and Chrome on Ubuntu-16.04 and Windows-8.1 using openvidu-browser-1.9.0-beta-1.js without an adapter.js file.

For testing on Safari on iOS 11.2.6 (15D100), several different adapter.js files have been added and tried individually:

https://webrtc.github.io/adapter/adapter-latest.js
https://apple.openvidu.io/webjars/webrtc-adapter/release/adapter.js (this works on the same iPad in https://apple.openvidu.io/ without "CAMERA ACCESS DENIED" error)

In both cases with
openvidu-browser-1.9.0-beta-1.js and REST API the Safari developer tool console gives the following error:

OpenViduError {name: "CAMERA_ACCESS_DENIED", message: "Error: Invalid constraint"}
  1. message: "Error: Invalid constraint"
  2. name: "CAMERA_ACCESS_DENIED"
  3. __proto__: OpenViduError


The same error occurs with openvidu-browser-1.9.0-beta-1.js only and no adapter.js file.


Thanks,

Dean


On Monday, March 19, 2018 at 9:03:47 AM UTC-7, Miguel Rodríguez Crespo wrote:
Reply all
Reply to author
Forward
0 new messages