WebRTC and the webserver.exe

Hi All,
After failing to get the Render Streaming functionality working, I have decided to look at streaming video using the WebRTC interface. However, I’m a bit confused about servers.

My requirement is to simply stream Unity video to either a browser or another Unity instance. So, really I don’t want to involve a server as I would consider this to be a peer-to-peer transfer only. However, it appears that I have to have a ‘stun’ server to negotiate formats and offerings (ie. I have no choice but to introduce a server into the system). When I looked at the Render Streaming functionality, Unity provided a webserver (webserver.exe). My question is, can I use this webserver.exe as a stun server for WebRTC, or do I need something different? My assumption would it be that it is fine because I am led to believe that Render Steaming functionality is simply a higher level implementation based on WebRTC, so I assume that webserver.exe is providing the stun capability in that case.

Any ideas?
Thanks in advance,
Dave

The STUN server is provided by Google for free, so you can use it.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302

Thanks, but one assumes these are on the internet. I’m not on the internet, but on a private network so I wouldn;t be able to access those.

In the case of WebRTC connection between PCs in LAN, STUN server is basically unnecessary.
Therefore, create an instance without arguments when creating an RTCPeerConnection instance and try running it.

var pc = new RTCPeerConnection();

I created a short tutorial (series is wip, but there are few videos already), if you’re interested :slight_smile:

https://www.youtube.com/watch?v=NmyXZvTfM0E

1 Like