Yes you can produce multiple tracks on one transport and you can consume multiple tracks on one transport. But you can’t mix producers, consumers on single transport i.e it is one way.
This is wrong and this is the root cause of your problem.
These are the steps for producer:
- Create send transport
- Listen for ‘connect’, ‘produce’ events
- produce() track
- this produce() will trigger ‘connect’, ‘produce’ events (which you are already listening)
- on ‘connect’, signal your server to connect the transport with connect_parameters from ‘connect’ event.
- on ‘produce’ signal your server to create producer there with produce_parameters from ‘produce’ event.
These are the steps for consumer:
- Create receiver transport
- Listen for ‘connect’ event
- Signal your server to create consumer with some data like producer id.
- do consume() track then
- consume() will trigger ‘connect’
- on ‘connect’ signal your server to connect the transport
But i already have a signaling server who create the transport and i return the transport config to the front end.
I have to create endpoint for connect and produce either if i understand you well ?
Do you have some exemple (for the back end endpoint) ?
I had checked the demo at the begininng, but i didn’t saw or understand that.
For exemple in this exemple (line 272):
This is not the endpoint expected for transport.on(“produce”, async (parameters, callback, errback) => {} ?
Yes you need to create endpoints for both connect, produce. Without them nothing is going to work.
You can see the connect endpoint in the file you shared, there will be some produce endpoint as well somewhere:
Here is my server side, you can see connect, produce, consume functions they are called when client side signals when connect, produce events occur, also on consume:
Thanks, can you show me your endpoint please ?
But what you showed me is not an endpoint for transport.on(‘connect’) listener ?
It’s endpoints for a signaling, and then once you have the transports information you do transport.on(‘connect’) and transport.on(‘produce’) no ?
Otherwise how you specify the route endpoint ?
For me everything is fine.
Because, based on this code, of this guy:
(server side): mediasoup/app.js at main · jamalag/mediasoup · GitHub
(client side): mediasoup/index.js at main · jamalag/mediasoup · GitHub
In back end (server side) there is no socket endpoint for produce and connect, but there is endpoint as a signaling server for sharing rtpCapabilities and transport configuration to the client side (front end).
And it work for him, it’s what i did.
I have a signaling server who share transport data between front end and back end.
And then in the front end i produce and consume.
This is getting ridiculous, it’s all documented and you’re copying and pasting. The time spent here on this problem is absolutely insane.
Not going to lie, it’s probably best you learn how to program before you bother us.
lmao, i think i know how to code.
Some issue doesn’t make sense because i have logic.
But thanks your comment is as relevant as your help.
That’s really funny because I don’t actually see code you wrote but repositories of other people’s code. You don’t even understand how it works with the client, if you’re asking these questions.
Additionally, you were told and helped by a few useful users here including myself if you searched. The issue is you’re not listening or absorbing the detail necessary.
I know how a client an server work.
If it wasn’t the case i wouldn’t try to build a one to many or few to many sfu server.
I code since many years now.
Maybe it’s pertinent for you but not for everyone ?
Ok then i listen you, where the problem come from ?
Go ahead
here are the server socket events:
and here it is on client side:
He is doing the way it should be, you are missing the things on your side.
@indie trying going through the documentation once more to get the thorough understanding of how the transport, producer, consumer flow works fully. You have some understanding but not full.
@BronzedBroth is right when he says the topic is getting lengthy.
Read. Find out.
I think i found, i try and i come back.
I guess i forgot
transport-connect
and
transport-producedata
Thanks, i try what i wrote previously and came back
transport-produce for media and transport-producedata for data channel
Yes transport-produce sorry, i was reading the full doc.
Thanks.



