DTLS state aren't changing

hi. thank you for visiting my topic
so i currently develop 2 things:

  • client side app hosted in vercel
  • mediasoup app hosted in EC2 (i serve the app using caddy and nip.io for ssl)

// this is my webrtc options
export const webRtcTransport_options = () => {
const HOST_PUBLIC_IP = process.env.APP_ANNOUNCED_IP;
return {
listenIps: [
{
ip: “0.0.0.0”,
announcedIp: HOST_PUBLIC_IP, // my public elastic ip in AWS
},
],
enableUdp: true,
enableTcp: true,
preferUdp: true,
};
};

first i successfully run an for my learning app from amir essaq tutorial and it worked with above setting
this is the port range i used:
APP_RTC_MIN_PORT=2000
APP_RTC_MAX_PORT=2020

this is my security group:

i notice that the big differences within my app and amir essaq was

  • amir serve the app on the same domain
  • i serve my client app on vercel with my mediasoup app in EC2

my app dont recieve any “dtlsstatechange” event
is there anything i did wrong and any explanation is welcome :slight_smile:

note: i tested my app locally, and it worked.

Check that the ports are reachable from the outside with some simpler tool (netcat, etc).

this is the result when i check it, connection to port 7000 seems fine, but i cant reach 2000-2020
image

and for more info, my websocket signaling is fine so i can assure that its not a websocket problem (im using socket io)

Well, that’s the problem then. Without the connection, there will be no dtlsstatechange or any other events.

@snnz but what possibly the cause? i set my port range with the above setup

Maybe someone else can help, I am not familiar with this hosting.


here said the transport connect request is suceeded,

And, as the documentation says, it doesn’t mean that the WebRTC transport is connected at ICE+DTLS level.

hi thanks for visiting my topic!

is there anything that you can give me as reference on what might be the cause?
i can’t seems to find the problem by logging, i tested on local and it work perfect, is this related to firewall?

it turns out that its only an env problem

i set env value in my worker creation like this, idk why its a problem when i host in ec2, it seems the env value not assigning
rtcMinPort: process.env.APP_RTC_MIN_PORT,
rtcMaxPort: process.env.APP_RTC_MAX_PORT,

now it works with me assigning it with a direct value

thanks for visiting and replying to my topic :slight_smile: