Search code examples
dockerkurento

How do I run kurento in a docker container, with kurento hello world example on host machine


I have cloned kurento docker so that I could use the kurento server in a container. And I am using the kurento-hello-world javascript version.

I use the following settings

  "net":
    {
        "websocket":
        {
            "port": "8888",
            "secure":
            {
                "port": "8080",
                "certificate": "defaultCertificate.pem",
                "password": ""
            },
            "path": "kurento",
            "threads": "10"
        }
    }

I have also configured the stun server for kurento

"WebRtcEndpoint":
        {
            "stunServerAddress": "<173.194.66.127>",
            "stunServerPort": "<19302>",
            "configPath": "\/etc\/kurento\/modules\/kurento"
        },

When I build the docker image I create a self signed certificate called defaultCertificate.pem in the same folder as the configuration. As i read that the kurento server needed to be connected to securely. I expose port 8080 in the docker container.

I then start the kurento-hello-world example on the host machine running on port 8443. I access the url as follows

https://localhost:8443/index.html?ws_uri=wss://localhost:8080/kurento

The hello world example gives an sdp offer. The issue is that the hello world examples then outputs.

WebSocket connection to 'wss://localhost:8080/kurento' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED

This means nothing shows up in the remote stream. And when I look at the kurento server log, nothing appears to be even logged.

In a nutshell, how do i get the hello world example to communicate with my kurento server which is running in docker.

EDIT: I move into the docker folder of the cloned repository and I run the docker like so:

docker build -t kurento .
docker run -t kurento

I do not add -p 8080:8080 as I expose the port in my docker file. Though i have tried it this way as well.


Solution

  • Whoops...not the brightest mistake, just had to change

    "stunServerAddress": "<173.194.66.127>",
    
    "stunServerPort": "<19302>",
    

    to

    "stunServerAddress": "173.194.66.127",
    
    "stunServerPort": "19302",
    

    Was looking in the wrong places.