simplewebrtc / signalmaster

simple socket.io server for webrtc signaling
Other
1.31k stars 486 forks source link

How to setup signalmaster in windows #122

Open ramutl87 opened 6 years ago

ramutl87 commented 6 years ago

Hello everyone,

I'm new to simpleWebRTC and signalmaster, locally i have implemented and it works fine.

In my hosting server at the time of production wanted to replace sandbox signaling server with my own signaling server url.

So as per the steps given in https://github.com/andyet/signalmaster , i have followed and everything works to be fine upto step 4, but got stuck while generating SSL.

i am using windows server, not getting how to run the below shell command in node.js

$ ./scripts/generate-ssl-certs.sh $ NODE_ENV=production node server.js

Any help is highly appreciated

Thanks in advance

mortenbirkelund commented 6 years ago

As you are on windows you probably dont have either Bash or Openssl installed which is required for running the script ./scripts/generate-ssl-certs.sh.

I ended up solving it this way.

  1. I ran these lines on a Linux installation i had access to

    mkdir -p ./config/sslcerts
    openssl genrsa -out ./config/sslcerts/key.pem 1024
    openssl req -new -key ./config/sslcerts/key.pem -out ./config/sslcerts/csr.pem
    openssl x509 -req -days 9999 -in ./config/sslcerts/csr.pem -signkey ./config/sslcerts/key.pem -out ./config/sslcerts/cert.pem
    rm ./config/sslcerts/csr.pem
    chmod 600 ./config/sslcerts/key.pem ./config/sslcerts/cert.pem
  2. I copied the new sslcerts folder containing key.pem and cert.pem to my signalmaster installation on windows and placed the folder inside the config folder.

  3. I sat the environmental variable in the windows system https://stackoverflow.com/questions/9249830/how-can-i-set-node-env-production-on-windows

Now i am able of running signalmaster by node.js

mortenbirkelund commented 6 years ago

And i used qckwinsvc to run signalmaster automatically on windows startup, as you can read here. https://stackoverflow.com/questions/20445599/auto-start-node-js-server-on-boot

1 Install qckwinsvc npm install -g qckwinsvc

2 Create the service qckwinsvc