WebDevSimplified / Zoom-Clone-With-WebRTC

1.52k stars 865 forks source link

How to get it running from outside of localhost #5

Open SilasK98 opened 4 years ago

SilasK98 commented 4 years ago

How to access this app from other devices/outside? I already have trouble if I try to access it with the ip adress of my computer instead of localhost. It throws the error: Uncaught TypeError: Cannot read property 'getUserMedia' of undefined at script.js:11. I guess thats due to the fact, that it is not running with https, but how to fix this?

ankitchouhan1020 commented 4 years ago

First, deploy peer js server on Heroku. Change your host to 'heroku url' from '/'. const myPeer = new Peer(undefined, { secure: true, host: "<app_name>.herokuapp.com", port: 443, });

Now deploy your app to heroku.

abhishekkumar08 commented 4 years ago

I want to work on your issue is it solved?? Kindly reply.

Hinster commented 4 years ago

I'm having the same problem with user SilasK98. I can run on localhost with no problem, but the minute I change to an ip addreess the video doesn't render. :(

thE-iNviNciblE commented 4 years ago

i receive this message "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://https//video.chattet.com:31337:3001/peerjs/id?ts=15967191593640.5015731332745829. (Reason: CORS request did not succeed)."

genzyy commented 4 years ago

i receive this message "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://https//video.chattet.com:31337:3001/peerjs/id?ts=15967191593640.5015731332745829. (Reason: CORS request did not succeed)."

This can be due to cors package not available on the directory. Install cors as an npm package and require it on the main js file.

nayan3d commented 4 years ago

To ignore Chrome’s secure origin policy, follow these steps.

Navigate to chrome://flags/#unsafely-treat-insecure-origin-as-secure in Chrome.

Find and enable the Insecure origins treated as a secure section.

Add any addresses you want to ignore the secure origin policy for. Remember to include the port number too (if required).

Save and restart Chrome.

giri-sh-irke commented 4 years ago

Hi, I recently implemented this application on a hosted server. It's quite simple. Npm's peer package also provides a way to integrate PeerJS server with express. In script.js the only change will be in new Peer() instance where we will need to specify the 'path' as well similar to this new Peer(undefined,{ 'host' : 'example.com', 'port': '9000', 'path' : '/peerjs' } The port number will be same as that of the express server(as we are now combining them) Even an SSL can be configured for PeerJS server.

thE-iNviNciblE commented 3 years ago

I solved my CORS Problem. :-)

Do you need a STUN / TURN Server like Coturn, Nextcloud - Extension -> Talk ist using it.