clarity on listenIP for docker in wsl2


new to mediasoup and trying to get a basic demo up so we can complete the initial review of the documentation etc.
our set up is
hosts file

generated .pem with

openssl req -x509 -nodes -days 365 -subj "/C=CA/ST=QC/O=Company, Inc./"  -newkey rsa:2048 -keyout /home/ssl/private/ -out /home/ssl/certs/; 
openssl x509 -in -out

and the config.js

// Listening hostname (just for `gulp live` task).
	domain : process.env.DOMAIN || '',
	// Signaling settings (protoo WebSocket server and HTTP API server).
	https  :
		listenIp   : '',
		// NOTE: Don't change listenPort (client app assumes 4443).
		listenPort : process.env.PROTOO_LISTEN_PORT || 4443,
		// NOTE: Set your own valid certificate files.
		tls        :
			cert : process.env.HTTPS_CERT_FULLCHAIN || `/home/ssl/certs/`,
			key  : process.env.HTTPS_CERT_PRIVKEY || `/home/ssl/private/`

I am confused as to what ip to put in the


field for a docker container running in wsl2.

Reading several posts I understand that using will cause the an error (no connection).
So using

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mediasoup

so we added this but get an error

WebSocket connection to ‘wss://’ failed: WebSocket opening handshake timed out

using the ui connects and I don’t get these error, but no A/V

What is the correct binding IP I should use?

After searching the docs I also could not find the correct ports to open,

			rtcMinPort : process.env.MEDIASOUP_MIN_PORT || 40000,
			rtcMaxPort : process.env.MEDIASOUP_MAX_PORT || 41001

I assume the port range should be 40000 - 41001


You are completely mixing WebSocket listen IP (which is NOT related to mediasoup but just to the mediasoup-demo server) and the RTC listen IPs.

Thanks for the quick reply Baz, could you decode that a little further please. when you say mixing up I applied to all areas in the demo config.js file

webRtcTransportOptions :
			listenIps :
					ip          : process.env.MEDIASOUP_LISTEN_IP || '',
					announcedIp : process.env.MEDIASOUP_ANNOUNCED_IP
			initialAvailableOutgoingBitrate : 1000000,
			minimumAvailableOutgoingBitrate : 600000,
			maxSctpMessageSize              : 262144,
			// Additional options that are not part of WebRtcTransportOptions.
			maxIncomingBitrate              : 1500000
		// mediasoup PlainTransport options for legacy RTP endpoints (FFmpeg,
		// GStreamer).
		// See
		plainTransportOptions :
			listenIp :
				ip          : process.env.MEDIASOUP_LISTEN_IP || '',
				announcedIp : process.env.MEDIASOUP_ANNOUNCED_IP
			maxSctpMessageSize : 262144

So is this incorrect place to put the IP or am I using the incorrect IP?

I note that in some of the posts on this forum, that some users populate

announcedIp : process.env.MEDIASOUP_ANNOUNCED_IP || ''

and others do not. Is this needed?
according to

f you use “” or “::” as ip value, then you need to also provide announcedIp
so I assume in the above config we DO NOT need to set it.

I am using the demo to make sure I have the correct ports open

After linking a lot of random threads, I believe this is due to self signed certs not working on wss.
so closing for now.

I don’t provide support about the demo project, sorry. The demo is not a substitute of the mediasoup documentation.

@ibc I can see where you are coming from, but for a lot of people, reverse engineering is the best way to learn. It has been a key the success of wowza take up for example. As a lot of people are now combining a number of new working technologies in parallel, it can be hard to isolate the problems of platform vs software.
And in this case, it is the limitation of certs and docker that I think was causing my issue.
I think you would get a number of people to more actively support the forum and increase the adoption if the initial learning curve was not as steep. You have already done the hard work of providing the demo, leveraging it to expand adoption should show a exponential growth curve if you can make the introduction a little easier to get up and running.

I’m not against that. But basically you are asking me to spend more time on this, and I want to do less rather than more. There are many users in this forum that could write those “mediasoup user-friendly docs”. I won’t do it because:

  1. I’m not being paid to do it.
  2. I don’t care about adoption (“mediasoup is difficult or too low level” → don’t use it).
  3. I don’t have time.
  4. Even if I had time I don’t want to spend it on something that I don’t need.

@artvan how were you able to fix this issue? I’m facing the same. My nodejs server is in a docker. I have passed in the docker container 172.18.x.x address, though it connects but unable to produce. It keeps failing in the producerTransport event.

By the way, i’m using the documentation @ibc :slight_smile: and have made quite a lot of progress already. The sample also provide a good understanding.

Would appreciate any help.