Navid_pdp11
Navid_pdp11

Reputation: 4012

why webRTC work by local Lan but not in Internet?

I create a webrtc sample based On this tutorial. this work on my local network fine and I can send and receive signal and videos. but when I connect from internet ti the server and two peer are not in same network video connection does not create.

I am using self sign Certificate and must add them two browsers. there is no error or exception. my signaling server is a web socket server written in nodejs.

Upvotes: 1

Views: 4130

Answers (1)

Denis Tsoi
Denis Tsoi

Reputation: 10404

Original Answer

I believe that you require a HTTPS (SSL certificate) if you are using Chrome +47 to be deployed online, but is not required if serving from a local machine on the same network.

According to caniuse; Edge and Firefox may yield non blocking results (but prefix with moz):http://caniuse.com/#feat=stream

http://caniuse.com/#feat=stream

The issue isn't necessarily WebRTC but getUserMedia/Stream API isn't provided when the called from a non-secure site (or non-localhost address).

Attached Image: (https://developers.google.com/web/updates/2015/10/chrome-47-webrtc)

https://developers.google.com/web/updates/2015/10/chrome-47-webrtc


Update:
Did a bit more digging around, and the following answer is related to the question getUserMedia() in chrome 47 without using https i.e. possible duplicate;

You "can" launch a Chrome browser to accept the insecure origin; however, that's temp. fix, whereas you'd probably want to get a certificate.

chrome.exe --user-data-dir=/test/only/profile/dir --unsafely-treat-insecure-origin-as-secure="http://example.com"

enter image description here

Upvotes: 1

Related Questions