Need Help Connecting Client with Kurento Server

529 views
Skip to first unread message

Muhammad Adil

unread,
Apr 24, 2019, 1:00:59 PM4/24/19
to kurento
Hi,


I am trying to connect kurneto server running i docker image with JS client but it's not connecting. (Logs can be downloaded from this link - https://drive.google.com/file/d/150a4VtjGRl6rGn9aFWiKK4cZgv5s9o7U/view?usp=sharing)

Here is my Kurento Setup

I need setting up kurento on docker. Here is how I am setting it up.

I have attached the dockerfile I am using to build the image (Docker_Setup.zip). Image is build successfully, attached are the logs (image_build_logs.md).

I ran the image with following command.

sudo docker run -d --name kms -p 8888:8888 itc_kms

Docker container image ran successfully. Attached is the log (docker_run.png)

I ran the docker logs command and it seems to be working fine. Attached are the logs (kurento_docker_logs.zip)

sudo docker logs kms


Here is my Client Setup

I cloned this repo


And ran the kurento-hello-world with following command (Ref: https://doc-kurento.readthedocs.io/en/6.10.0/tutorials/js/tutorial-helloworld.html)

http-server -p 8443 -S -C keys/server.crt -K keys/server.key


I am getting this error (Screenshot: hello_world_output.png)


  • Use freeice
  • spec: {"audio":true,"video":{"width":640,"framerate":15}}
  • chrome: {"audio":true,"video":{"optional":[{"minWidth":640},{"maxWidth":640},{"minFramerate":15},{"maxFramerate":15}]}}
  • reconnect to server0100undefined
  • reconnect to server1100undefined
  • reconnect to server2200undefined
  • reconnect to server3300undefined
  • reconnect to server4500undefined
  • reconnect to server5800undefined
  • reconnect to server61300undefined
  • reconnect to server72100undefined
  • reconnect to server83400undefined
  • reconnect to server95500undefined
  • reconnect to server108900undefined
  • reconnect to server1110000undefined
  • reconnect to server1210000undefined
  • reconnect to server1310000undefined
  • reconnect to server1410000undefined

Please help me what I am doing wrong. Thanks.

hello_world_output.png

Muhammad Adil

unread,
Apr 24, 2019, 1:03:26 PM4/24/19
to kurento
Attached are files In-case can't download from google drive
docker_run.png
image_build_logs.md
Docker_Setup.zip

Juan Navarro

unread,
Apr 25, 2019, 6:22:07 AM4/25/19
to kurento

Muhammad Adil

unread,
Apr 25, 2019, 7:47:59 AM4/25/19
to kurento
Getting the same issue :(. Attached is the screenshot (kurent_in_url.png). Just wondering if the issue is connecting with ICE server because in the demo it's undefined.
kurent_in_url.png

Juan Navarro

unread,
Apr 25, 2019, 7:57:04 AM4/25/19
to kur...@googlegroups.com
I don't think it is the ICE server (yet), but please copy exactly this URL and paste in the browser:
The small difference with your screenshot is the "wss://"... Kurento is not configured to use secure sockets so the browser client cannot connect to "wss://" URL, you should try with "ws://"

If it works, then you can start from a good ground in there and add features one by one (such as secure websocket if Kurento will be publicly available; another option is to deploy it in a protected network that you have 100% control)
--
You received this message because you are subscribed to a topic in the Google Groups "kurento" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kurento/5rsnYLn1y48/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kurento+u...@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/3daa2855-3256-4dfe-93c9-95217cd4e272%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Muhammad Adil

unread,
Apr 25, 2019, 8:08:48 AM4/25/19
to kurento
Thanks for the quick response but now I am getting this error.

SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.


On Thursday, April 25, 2019 at 4:57:04 PM UTC+5, Juan Navarro wrote:
I don't think it is the ICE server (yet), but please copy exactly this URL and paste in the browser:

https://localhost:8443/index.html?ws_uri=ws://localhost:8888/kurento

The small difference with your screenshot is the "wss://"... Kurento is not configured to use secure sockets so the browser client cannot connect to "wss://" URL, you should try with "ws://"

If it works, then you can start from a good ground in there and add features one by one (such as secure websocket if Kurento will be publicly available; another option is to deploy it in a protected network that you have 100% control)


On 25/4/19 13:47, Muhammad Adil wrote:
Getting the same issue :(. Attached is the screenshot (kurent_in_url.png). Just wondering if the issue is connecting with ICE server because in the demo it's undefined.



On Thursday, April 25, 2019 at 3:22:07 PM UTC+5, Juan Navarro wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "kurento" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kurento/5rsnYLn1y48/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kur...@googlegroups.com.
ws_socket_error.png

Juan Navarro

unread,
Apr 25, 2019, 8:27:33 AM4/25/19
to kur...@googlegroups.com
Hi,

I have updated the instructions on all Browser Javascript tutorials, to remove the confusion about "ws://" and "wss://". This update is now uploaded in the "Latest" version of the documentation. Please have a look here:
https://doc-kurento.readthedocs.io/en/latest/tutorials/js/tutorial-helloworld.html

Also the WebRTC Adapter.js library is updated in all tutorials, so please do not git checkout the 6.10.0 tag, leave it at "master" branch instead (by default after "git clone").

I have just followed the steps of Hello World JS tutorial and it worked fine for me with these steps:

* Follow instructions from https://doc-kurento.readthedocs.io/en/latest/tutorials/js/tutorial-helloworld.html

* Do NOT run the command "git checkout 6.10.0"

* Run Kurento with Docker image:
docker run --rm -ti -p 8888:8888 kurento/kurento-media-server-dev:latest

* Open in Chrome:
It worked and I can see Local and Remote streams, with Chrome 73 right now.

I also tried with Firefox and see some errors, it doesn't allow capturing the webcam in insecure pages so it shows errors about "Insecure operation"... but for these kinds of local tests, you should see it working with Chrome.

Regards
To unsubscribe from this group and all its topics, send an email to kurento+u...@googlegroups.com.

To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.

Muhammad Adil

unread,
Apr 25, 2019, 8:42:26 AM4/25/19
to kurento
I followed your instructions.

- Downloaded the docker image you asked
- Downloaded the repo again and kept it in master

Still getting this error :(

SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

Juan Navarro

unread,
Apr 25, 2019, 8:44:34 AM4/25/19
to kurento
That's strange... I tested it right before answering here.
What browser version are you using?

Muhammad Adil

unread,
Apr 25, 2019, 8:50:05 AM4/25/19
to kurento


Google Chrome
Version 74.0.3729.108 (Official Build) (64-bit)

Juan Navarro

unread,
Apr 25, 2019, 9:21:56 AM4/25/19
to kur...@googlegroups.com
I thought this maybe is a new security policy of Chrome in version 74, but after upgrading to latest version it still works.
I have tested with a clean Chrome profile (no extensions, no plugins) and following the steps works fine:






The error you mention means that one shouldn't connect to an unsecured websocket (ws://) from a secured website (https://), but since the HTTPS certificate is invalid anyway, and you had to accept a security exception for it, the end result should be that the WebSocket can connect without any issues.


It also works for with HTTP as long as it is localhost; you can start the web server like this:

http-server -p 8443

And access here:

http://localhost:8443/index.html?ws_uri=ws://localhost:8888/kurento

And it should also work.


If nothing of this works, there must be something different with that Chrome profile, of there are differences between how Chrome behaves in different operating systems. In any case, the proper solution is to configure Kurento with secure sockets, by setting the certificate here:

/etc/kurento/kurento.conf.json

(https://github.com/Kurento/kurento-media-server/blob/master/kurento.conf.json#L17)
To unsubscribe from this group and all its topics, send an email to kurento+u...@googlegroups.com.

To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.

Muhammad Adil

unread,
Apr 25, 2019, 10:32:26 AM4/25/19
to kurento
It did not work for me. I will try again tomorrow.

Juan Navarro

unread,
Apr 25, 2019, 11:51:47 AM4/25/19
to kur...@googlegroups.com
Hi, I realized why it didn't work for you. I'm running the tutorial in localhost, you are changing it to something else.

Chrome has security exceptions for localhost but those are disabled if you use any other hostname or IP address. If that is the case, you need to configure a certificate for Secure WebSocket (WSS://) in /etc/kurento/kurento.conf.json

I have edited documentation pages to have better explanations of this, so next time it is clearer:
https://doc-kurento.readthedocs.io/en/latest/tutorials/js/tutorial-helloworld.html
To unsubscribe from this group and all its topics, send an email to kurento+u...@googlegroups.com.

To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.

Muhammad Adil

unread,
Apr 25, 2019, 12:41:06 PM4/25/19
to kurento
Thanks man. You were right. I am working on my aws machine but working on local machine worked. Thanks alot.

Just one last question on docker kurento/kurento-media-server-dev:latest image stay in unhealthy state and kurento/kurento-media-server:latest keep restarting for some reason. That was the reason I made the image myself from openvidu Dockerfile.
Reply all
Reply to author
Forward
0 new messages