1
votes

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.

3
Is the webpage in which you are trying to access peer.js is being loaded over https? - Obscure Geek
yes my page is loaded over https which is accessing peer.js - user4082518
If your page is loaded over https, then all the content you try to load within it has to be over https only. If you try to use http the browser blocks it for security reasons. So I think in your case, peer.js is trying to load something over http within it. If you can then try loading your page over http once just to verify if what I said is true. - Obscure Geek
I tried loading my page over http then i got " getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See goo.gl/rStTGz for more details." Warning and the video is not required. - user4082518

3 Answers

3
votes

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
2
votes
0
votes

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.