Project Setup
To initiate your Mediasoup project, you can refer to the following repository: ObserveRTC Full Stack Examples
Starting the Application
To launch the application, execute the following command in your terminal:
SFU_ANNOUNCED_IP="192.168.60.79" docker-compose up
Common Error Encountered
While starting the application, you may encounter an error similar to the one below:
ObserveRTC::RestTransport Wed, 14 Dec 2022 07:44:56 GMT Request failed. canRetry: true Error: getaddrinfo ENOTFOUND host.docker.internal
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'host.docker.internal'
}
This error indicates that the application is unable to resolve the hostname host.docker.internal. This typically occurs when the Docker container cannot access the host machine's network.
Finding Your IP Address
To resolve this issue, you can verify your local IP address using the ifconfig command. Here’s an example output:
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.60.79 netmask 255.255.255.0 broadcast 192.168.60.255
...
Ensure that the IP address you use in the SFU_ANNOUNCED_IP variable matches your local network configuration. Adjust the configuration as necessary to ensure proper connectivity between your Docker containers and the host machine.