deepch / RTSPtoWebRTC

RTSP to WebRTC use Pion WebRTC
MIT License
1.57k stars 418 forks source link

Adding TURN creds #77

Open abergdesign opened 3 years ago

abergdesign commented 3 years ago

Hi, could I add a TURN server to the ICE Servers? I spent an hour on it but didn't get anywhere. Thank you for a great project! Ulf

tfmeneses commented 3 years ago

Hi @deepch ,

I'm using the pion/turn.

Do you have any idea how to implement this? I can observe that we need to change the ICE Server struct, right?

abergdesign commented 3 years ago

Hi both,

I now think a turn server will only make sense if the server code can be separated from the "peer" code (which is reading the rtsp stream), so those two functions (server and peer) can run on different machines. Otherwise stun is enough since a server will always be reachable by any browser clients by default. Am I right in this assumption?

My use case is an IP cam on a LAN with an edge device (think raspberry pi) on a LAN that cannot be accessed from the internet and no port forwarding is available since it is over a cellular network. I'd need the rtsp code/webRTC peer on the edge and the server code on the internet. Many thanks!

travishaagen commented 3 years ago

@deepch I can put up a PR shortly. Done.

abergdesign commented 3 years ago

Thank you! Can you confirm if it is possible to run the server code on a separate machine from the RTSP/peer code? The machine having access to the RTSP stream is not exposed to the internet. Many thanks, Ulf Aberg Design