mediasoup-sample icon indicating copy to clipboard operation
mediasoup-sample copied to clipboard

I am setting up this on amazon aws server but not working

Open paragikjain opened this issue 4 years ago • 21 comments

It is working on localhost but on amazon aws it is not working do we have to change ip address any where in code?

paragikjain avatar May 21 '20 16:05 paragikjain

Yes, in server/config.js you have to change rtcAnnouncedIPv4 to the public IP address of your AWS server.

footniko avatar May 21 '20 16:05 footniko

I have done like this is it right way?

rtcAnnouncedIPv4: 13.52.248.221,

paragikjain avatar May 21 '20 16:05 paragikjain

http://localhost:8080/socket.io/?roomId=room1&peerName=Bob&EIO=3&transport=polling&t=N8u7qLQ

getting this error on console it should not localhost there my public ip should come where to change this

paragikjain avatar May 21 '20 16:05 paragikjain

Please. inspect frontend/public files for matches.

footniko avatar May 21 '20 16:05 footniko

thanks brother that issue has been resolved but i got one more

TypeError: Cannot read property 'getUserMedia' of undefined

may be this is because of ssl can you help me with this how to resolve this

paragikjain avatar May 21 '20 17:05 paragikjain

Have you installed npm packages for the frontend app as mentioned in the Readme?

footniko avatar May 21 '20 17:05 footniko

yes i have installed properly as per readme instructions

paragikjain avatar May 22 '20 20:05 paragikjain

Hi @paragikjain ,@footniko, I am also getting the error TypeError: Cannot read property 'getUserMedia' of undefined. Can you please let me know if you have resolved it .

Regards, Hari Vyas

harivyas35 avatar Jun 20 '20 20:06 harivyas35

Are you using SSL?

footniko avatar Jun 21 '20 07:06 footniko

HI, I am not using SSL But i am getting different error now . Failed to load resource: net::ERR_CONNECTION_REFUSED -- socket.io.js1 app.js:9 Uncaught ReferenceError: io is not defined at app.js:9

I am using nginx for reverser proxy at localhost:3000 Regards, Hari Vyas

harivyas35 avatar Jun 21 '20 08:06 harivyas35

@harivyas35 it means it can't find io (socket.io-client lib) that's been loaded with index.html
Make sure you started the server and change the port in index.html: https://github.com/footniko/mediasoup-sample/blob/master/frontend/public/index.html#L5

footniko avatar Jun 21 '20 08:06 footniko

HI, The server is running . Can you please suggest me to which port should i change .

Regards, Hari Vyas

harivyas35 avatar Jun 21 '20 09:06 harivyas35

Please, google how to use socket.io on server and client sides. Those are basic things that are not related to this sample. As I specified, you have to use the port your socket server is running on here: https://github.com/footniko/mediasoup-sample/blob/master/frontend/public/index.html#L5

footniko avatar Jun 21 '20 09:06 footniko

HI , Thank you for your quick replies. My socket server is running on port 8080 And the same port i have used in index.html file . But still the error is coming .

Regards, Hari Vyas

harivyas35 avatar Jun 21 '20 09:06 harivyas35

I am using nginx for reverser proxy at localhost:3000 Are you using the app with Nginx or directly?

Failed to load resource: net::ERR_CONNECTION_REFUSED -- socket.io.js1

It clearly says it can't reach http://localhost:8080/socket.io/socket.io.js Make sure you can open it in your browser without errors

footniko avatar Jun 21 '20 09:06 footniko

Hi , I am using the app with nginx , on Aamazon EC2 . Regards,

harivyas35 avatar Jun 21 '20 09:06 harivyas35

So, you have your app deployed to AWS ec2 and trying to reach it with localhost URL? Change http://localhost:8080/socket.io/socket.io.js to https://your-domain/socket.io/socket.io.js

footniko avatar Jun 21 '20 09:06 footniko

Hi , I changed it tom my domain name . But still no luck . Below is the error . Failed to load resource: the server responded with a status of 404 (Not Found) app.js:9 Uncaught ReferenceError: io is not defined at app.js:9 The doamin is - http://ec2-13-233-96-31.ap-south-1.compute.amazonaws.com

Regards, Hari VYas

harivyas35 avatar Jun 21 '20 10:06 harivyas35

@harivyas35 http://ec2-13-233-96-31.ap-south-1.compute.amazonaws.com is not reachable. Make sure you configured your Nginx proxy properly

footniko avatar Jun 21 '20 13:06 footniko

HI @footniko , Please check now (http://ec2-13-233-96-31.ap-south-1.compute.amazonaws.com ),it was closed by mistake , it is running now and the nginx config file is below. server { listen 80 default_server; server_name _;

location / { proxy_pass http://localhost:3000/; } }

The frontend is running at port 3000

harivyas35 avatar Jun 21 '20 14:06 harivyas35

@harivyas35 if it's the full code, it's wrong, please google how to configure Nginx with node.js apps. Also, make sure all the needed UDP ports are opened in AWS console

footniko avatar Jul 06 '20 13:07 footniko