Deploying on shared hostings

Hello. Spent a lot of time to understand possibility to deploy mediasoup on shared hosting. So I managed to connect protoo client but ICE does not work. So… I tried it investigate network configuration on the hosting and it seems that that current ip is used by multiple hosts. And it looks like there is no NAT (so I guess no need to setup announcedIp). So basically here is what I’m getting with “ifconfig”:

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 68.66.xxx.xxx netmask 255.255.255.192 broadcast 68.66.xxx.xx
eno1:cp1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 85.187.xxx.xxx netmask 255.255.255.240 broadcast 85.187.xxx.xxx

eno1:cp2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 85.187.xxx.xx netmask 255.255.255.240 broadcast 85.187.xxx.xx

(…etc till cp42)

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0

So my public ip is 68.66.248.48. And I were able to transfer small data just for test to this IP with some simple nodejs tcp client/server. Here are my settings (I’m using mediasoup example config with next changes):

“https”: {
“listenIp”: “0.0.0.0”,
“listenPort”: 45360,
“tls”: {
“cert”: “/home/mindlang/mserver/certs/fullchain.crt”,
“key”: “/home/mindlang/mserver/certs/privkey.key”
}
},
“mediasoup”: {
“numWorkers”: 4,
“workerSettings”: {
“logLevel”: “warn”,
“logTags”: [
“info”,
“ice”,
“dtls”,
“rtp”,
“srtp”,
“rtcp”,
“rtx”,
“bwe”,
“score”,
“simulcast”,
“svc”,
“sctp”
],
“rtcMinPort”: 40000,
“rtcMaxPort”: 49999
},

“webRtcTransportOptions”: {
“listenIps”: [
{
“ip”: “68.66.xxx.xx”
}
],
“initialAvailableOutgoingBitrate”: 1000000,
“minimumAvailableOutgoingBitrate”: 600000,
“maxSctpMessageSize”: 262144,
“maxIncomingBitrate”: 1500000
},

Any advice what to check, how to debug the problem. if it possible at all to deploy it on the server with shared ip? As far I understant the ip should be “bindable” but I don’t fully inderstand if my case or not.

Thank’s

Are we pertaining to mediasoup-server? Because mediasoup is just a node package.

Asuming from the config you have posted I think you’re probably asking about deploying mediasoup-server. In my case I was able to deploy it on an AWS EC2 and here is the checklist that I would recommend.

  1. Ensure that your https port is allowd by your firewall.
  2. Ensure that udp ports 40000 to 49999 are allowed by your firewall.
  3. Ensure that tcp ports 40000 to 49999 are allowed by your firewall.
  4. Make sure you are:
    i) Either providing listenIp and announcedIp in config.js correctly
    OR
    ii) Setting MEDIASOUP_LISTEN_IP and MEDIASOUP_ANNOUNCED_IP env variables.

If the listenIp and announced Ip are not set properly the website will work but there will be no media traffic as the IP address that the server is advertising would be incorrect.

1 Like

I’m trying to deploy mediasoup demo app. I think the problem with MEDIASOUP_ANNOUNCED_IP. But I don’t fully understand what should I use there. I dont have any private ip. Private and public are same…
Https - is ok everything is working except ICE (no audio, video and chat) . Tcp ports from those range seems to be ok. I tried to deploy some simple tcp nodejs server on some of them and it was ok… I did not check udp, will do today. But I’m pretty sure something wrong with listening and announcing ip’s. If you have any idea how to debug it - highly appreciate.

Thank’s

Have you read the docs about WebRtcTransport and the FAQ in the website?

If you don’t have a private IP you don’t need to set any announced public IP anywhere. To understand that (rather than just looking at the config.js file of the demo app).

2 Likes

Yes I understand that rather I don’t need it. Because it seems that there is no NAT. But without it does not work anyways, so maybe I’m missing something in the network configuration… No idea. I need to understand how to debug it

Ok. it seems that there is some problem with UDP… I added &forceTcp=true - and it seems to be fine now. So I guess firewall blocks udp connection but tcp no. For some reasone…

1 Like