1

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.

Navid_pdp11
  • 3,487
  • 3
  • 37
  • 65
  • what browser are you using? - chrome? – Denis Tsoi Mar 09 '17 at 10:01
  • yes it is chrome in both side – Navid_pdp11 Mar 09 '17 at 10:10
  • Please refer to answer below; @navid_pdp11 – Denis Tsoi Mar 09 '17 at 10:10
  • Are you using any STUN/TURN servers…? – deceze Mar 09 '17 at 13:24
  • Yes i am using a list of stun servers.... – Navid_pdp11 Mar 09 '17 at 20:19
  • 1
    did you verify those servers work? If the turn server credentials say this: { 'url': 'turn:192.158.29.39:3478?transport=udp', 'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', 'username': '28224511:1379330808' }, { 'url': 'turn:192.158.29.39:3478?transport=tcp', 'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', 'username': '28224511:1379330808' } then you'll want to read the note in https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/#after-signaling-using-ice-to-cope-with-nats-and-firewalls – Philipp Hancke Mar 09 '17 at 21:08
  • We need more information. Is the `getUserMedia` step failing (or does self-view work?), or does it fail in the `RTCPeerConnection` step, e.g. you're not getting ICE candidates? Don't make us guess. – jib Mar 10 '17 at 04:16

1 Answers1

1

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

Community
  • 1
  • 1
Denis Tsoi
  • 9,428
  • 8
  • 37
  • 56
  • would you mean if i create a registered certificate id will work ok? and self sign certificate work only for local peer? – Navid_pdp11 Mar 09 '17 at 10:18
  • is there any solution for create ssl cert freely? and for this i must have a domain on my host or i can create ssl for my ip ? – Navid_pdp11 Mar 09 '17 at 10:24
  • if you use a registered cert from a registered provider, then chrome will act nicely. however, if you self sign - chrome will tend to not acknowledge it as "safe". you could try to go via OpenSSL, i need to get back to you on that (as it's not within my own experience in getting that to work). – Denis Tsoi Mar 09 '17 at 13:05
  • If you get Chrome to accept the certificate at all, to open the website at all, then it is *accepted*. Using a CA just automates the process of accepting the certificate, it does not bestow a higher degree of trust than a properly acknowledged self-signed certificate. – deceze Mar 09 '17 at 13:24
  • for users who down vote - could you please provide a better answer/feedback on how i can improve the answer; thanks; – Denis Tsoi Mar 09 '17 at 13:27