MediaSoupError: port bind failed due to address not available [udp:1.2.3.4, attempt:1]

Hi,
I have installed the client and server packages. When I deployed me the following error in the chrome console:

mediasoup-demo:ERROR:RoomClient _joinRoom() failed:Error: 500
at Peer._handleResponse (:3000/mediasoup-demo-app.js?v=foo:47251)
at WebSocketTransport. (:3000/mediasoup-demo-app.js?v=foo:47183)
at emitOne (:3000/mediasoup-demo-app.js?v=foo:27275)
at WebSocketTransport.emit (:3000/mediasoup-demo-app.js?v=foo:27353)
at WebSocketTransport.safeEmit (:3000/mediasoup-demo-app.js?v=foo:35892)
at WebSocket._ws.onmessage (:3000/mediasoup-demo-app.js?v=foo:47498) +0ms
debug @ :3000/mediasoup-demo-app.js?v=foo:29961

And on the server side:

mediasoup:ERROR:worker[pid:6571] RTC::PortManager::Bind() | throwing MediaSoupError: port bind failed due to address not available [udp:1.2.3.4, attempt:1] +0ms
mediasoup:WARN:Channel[pid:6571] request failed [method:router.createWebRtcTransport, id:3]: port bind failed due to address not available [udp:1.2.3.4, attempt:1] +0ms
mediasoup-demo-server:ERROR:Room request failed:Error: port bind failed due to address not available [udp:1.2.3.4, attempt:1] at Channel._processMessage (/home/franklonchas/Documentos/mediasoup-demo/server/node_modules/mediasoup/lib/Channel.js:284:19) at Socket.Channel._socket.on (/home/franklonchas/Documentos/mediasoup-demo/server/node_modules/mediasoup/lib/Channel.js:101:13) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at Pipe.onread (net.js:607:20) +5m
mediasoup-demo-server:Room protoo Peer “close” event [peerId:fiyi4xnm] +18ms

Any ideas to solve this and be able to start working with the demo?
Thanks for the attention, a greeting! :smiley:

That log look interesting, right? Does your host have IP 1.2.3.4?

1 Like

Oh wow, thats nice, i change it for localhost and work!!!

Thanks a lot!!

:slight_smile:

BTW it’s extremely important that you focus on the mediasoup API documentation instead of relying on the demo application.

1 Like

You are right but nevertheless it is something complicated to understand, for me.
I will make an effort to understand it better.
One more question, when I put two or more clients in the same room, they see each other but I can not see or hear anything. Why is this ??

I do not see any errors in the console

I don’t know where and how you are deploying the demo application. If you are running the Node.js application in a separate server and use “127.0.0.1” as WebRTC transport listen IP, for sure clients won’t be able to connect at media level.

I installed the app as you say, and then change the ip to 127.0.0.1, I do not know if I should change / add something

You have not clarified whether you have installed the mediasoup-demo server in a separate host or in the same host in which you run the browsers.

I have it installed on my PC in a normal way, on the same host, when I get in from the same PC I can see and hear the other clients, when I try from the phone, I see the connected client but I do not see or receive anything from the .

And apparently I do not have any errors in the 2 consoles.

How do you expect a mobile to connect to 127.0.0.1 in a different host?

At some point reading the doc is necessary:

1 Like

Now that I think about it, it sounds logical. Looking at the documentation that has happened to me, we must put the address such that -> listenIps: [{ip: “192.168.0.111”, previouslyIp: “88.12.10.41”}]

the first ip would be the one of the server in local and the second the ip publish true?

One more question, to put it in deploy the example that more would be necessary? Is it referenced in the documentation? To be more accurate, my need at this time is to put the project that you have in production as an example, in production on another server of mine.

I would like to know how to do it step by step, really its API is complex and it is difficult for me to understand things like what to do with the client, and server to put it into production.

Thank you very much for the inconvenience of answering my questions.

I’m afraid I cannot provide step by step instructions to get the demo application running in a server. That’s not the purpose of this forum and I prefer to spend time giving free support about mediasoup itself. The demo app is just a demo, not a full application or product for anyone to deploy at it is.

Ok, i understand it. Any docs or video for that?
And can you response me to the “listenIps” please??

Thanks a lot!

No, there is no docs or video about how to deploy the demo app (other than the instructions in the README).

The listenIps setting is explained in the doc:

1 Like