Coder Social home page Coder Social logo

Comments (6)

azhar1038 avatar azhar1038 commented on June 21, 2024

Also I was able to run the mediasoup-demo without problem. But this one is not working and this is my config.js file:

module.exports = {
  listenIp: '0.0.0.0',
  listenPort: 3000,
  sslCrt: '/service/certs/fullchain.pem',
  sslKey: '/service/certs/privkey.pem',
  mediasoup: {
    // Worker settings
    worker: {
      rtcMinPort: 10000,
      rtcMaxPort: 10100,
      logLevel: 'warn',
      logTags: [
        'info',
        'ice',
        'dtls',
        'rtp',
        'srtp',
        'rtcp',
        // 'rtx',
        // 'bwe',
        // 'score',
        // 'simulcast',
        // 'svc'
      ],
    },
    // Router settings
    router: {
      mediaCodecs:
        [
          {
            kind: 'audio',
            mimeType: 'audio/opus',
            clockRate: 48000,
            channels: 2
          },
          {
            kind: 'video',
            mimeType: 'video/VP8',
            clockRate: 90000,
            parameters:
              {
                'x-google-start-bitrate': 1000
              }
          },
        ]
    },
    // WebRtcTransport settings
    webRtcTransport: {
      listenIps: [
        {
          ip: '127.0.0.1',
          announcedIp: '192.168.43.225',
        }
      ],
      maxIncomingBitrate: 1500000,
      initialAvailableOutgoingBitrate: 1000000,
    }
  }
};

from mediasoup-sample-app.

mkhahani avatar mkhahani commented on June 21, 2024

Except the server is behind NAT or proxy you don't need to set the announcedIp and setting the ip with the server IP would be enough.

from mediasoup-sample-app.

azhar1038 avatar azhar1038 commented on June 21, 2024

I changed the config.js with this:

     listenIps: [
        {
          ip: '192.168.43.225',
          announcedIp: null,
        }
      ],

192.168.43.225 is my local IP and definitely it is not behind a NAT or proxy but now I am getting this error in server console:

Error: port bind failed due to address not available [transport:udp, ip:'192.168.43.225', port:10001, attempt:1/101]
    at Channel._processMessage (/service/node_modules/mediasoup/lib/Channel.js:199:37)
    at Socket.Channel._consumerSocket.on (/service/node_modules/mediasoup/lib/Channel.js:61:34)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

from mediasoup-sample-app.

azhar1038 avatar azhar1038 commented on June 21, 2024

Sorry! My mistake. I forgot to forward the rtc min and max port for docker.

from mediasoup-sample-app.

azhar1038 avatar azhar1038 commented on June 21, 2024

Also it works only when I set listenIps to something like:

      listenIps: [
        {
          ip: '0.0.0.0',
          announcedIp: '192.168.43.225',
        }
      ],

Can you please give some insight about Ip and announcedIp?
I thought announcedIp is where others will receice stream.

Use ip: '0.0.0.0' and announcedIp: HOST_PUBLIC_IP when creating a transport.

I found this in FAQ of mediasoup

from mediasoup-sample-app.

mkhahani avatar mkhahani commented on June 21, 2024

ip is the network address that server starts listening on it and announcedIp is the IP address that client connects to. When the server has a public IP and the client is direct to it, then setting the announcedIp is unnecessary, although setting both ip and announcedIp with the same public IP works too.

When the server has several IPs then 0.0.0.0 matches all addresses in the IPv4 address space.

from mediasoup-sample-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.