when i used this http://cdnjs.cloudflare.com/ajax/libs/peerjs/0.3.14/peer.js its was giving following error
was loaded over HTTPS, but requested an insecure script 'http://cdnjs.cloudflare.com/ajax/libs/peerjs/0.3.14/peer.js'. This request has been blocked; the content must be served over HTTPS.
after adding https://cdnjs.cloudflare.com/ajax/libs/peerjs/0.3.14/peer.js its started giving
was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '0.peerjs.com:9000/c03lztxhq78vkj4i/…;. This request has been blocked; the content must be served over HTTPS.
check its compatability support of peerjs http://peerjs.com/status/old
This is due to mixed-content blocking - try loading the secure version e.g.
https://cdnjs.cloudflare.com/ajax/libs/peerjs/0.3.14/peer.js
Might be late but anyways this might help some ...
In case of Peer Js :
If you’re planning to deploy to a remote server, it has to be via HTTPS. This is because browsers only allows to access device if connection is secure.
This article might help ( Read under the title: Deploying to remote server ).
If curious, also consider having a look at web fundamentals. ( Read under the title : An XMLHttpRequest example ).
Extra stuff : You can also read this documentation to prevent mixed content.
来源:https://stackoverflow.com/questions/34526740/peer-js-is-not-working-http-but-not-on-https