WebDevSimplified / Zoom-Clone-With-WebRTC

1.52k stars 865 forks source link

Please help me out to run this JS program to work on cloud server #23

Open paully1004 opened 4 years ago

paully1004 commented 4 years ago

Hi I have installed this JS script on my website at slingyo.com. However, it is not working at all, Node JS has been installed at server by tech support. I am very beginner and struggling for make this JS program to up & running at my cloud web address slingyo.com Please help me out

ashishlijhara commented 4 years ago

its quite easy.

  1. Run your instance
  2. Clone the repo
  3. Make sure you have node v 10.0 or higher installed.
  4. Allow connections to port 443 and 3001 (if you are running peerjs as in video) or just init myPeer as: myPeer = new Peer(undefined, {}) // no options - will use peer cloud
  5. Generate a self-signed certificate, run the following in your shell: openssl genrsa -out server-key.pem openssl req -new -key server-key.pem -out csr.pem openssl x509 -req -days 9999 -in csr.pem -signkey -server-key.pem -out server-cert.pem rm csr.pem
  6. Now copy server.key.pem and server-cert.pem to root of the project add the following code to server.js: const fs = require('fs') const https = require('https') const options = { key:fs.readFileSync('server-key.pem'), cert: fs.readFileSync('server-cert.pem') } const httpsServer = https.createServer(options, app)
  7. Replace const io = require('socket.io')(server) with const io = require('socket.io')(httpServer)
  8. Listen on 443: replace server.listen(80) with httpsServer.listen(443)
  9. Run node server.js
  10. Make sure firewall is turned off. Now connect to the instance in the browser of your choice.
qqq89513 commented 4 years ago

Hi I had have the same need and problem as @paully1004 had have. Thanks to @ashishlijhara, I figured it out and created a README.md Please check out the forked repository.