-
Hey Everyone, I am trying to make a desktop streamer app that can stream my screen, Mic Audio and Speaker Audio in web. I made a simple demo that can stream my desktop. Now the Issue is I am able to connect my stream on local network, but I am unable to connect when my host and viewer are in different network. I searched about it and found https://github.com/sipsorcery-org/sipsorcery/discussions/974 so I made chrome://flags/#enable-webrtc-hide-local-ips-with-mdns flag disabled but still the issue persists. Then I thought that my firewall may be stopping my Peer Connection so I disabled my firewall but it didn't work as well. I also found one solution to add ice candidate after Offer/Answer is set on Stack Overflow and tried it but still it didn't work. Moreover that I also tried my private Turn server but no luck with that. So Currently I am clueless about the Issue that is stopping WebRTC to connect. Now about my code, I am using Visual Studio 2017 and .NET Framework 4.8 for my Windows Forms App and I connect to my socket in my Form1's Loaded event. More details are given below... I am using below Nuget Packages in my project:
Now there are 4 classes:
IISMethod:
Socket:
VideoTestPatternSource:
WindowsAudioEndPoint:
Now About Web Side Code: There are 2 files:
index.js:
webrtc.html:
Now If someone could help me with this then it would be a great help. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
If you paste the sipsorcery logs from when you start the peer connection and ICE negotiation process we may be able to help. |
Beta Was this translation helpful? Give feedback.
-
Seems like a stock standard NAT issue. Your STUN requests sent directly to the remote peer are not getting a response. Do you have credentials for the TURN serve? As far as I know Twilio's TURN server is not anonymous and that would explain why you're not getting a response from it. |
Beta Was this translation helpful? Give feedback.
-
Hi, I was busy elsewhere and now I started working with WebRTC once again after a while. First I reviewed my code and found out that I am adding local ice candidate in my PC in desktop side but not doing that in my web (index.js). So I tried it it and I think that was the issue. Now my stream is connecting over different networks (even on networks with firewalls). The major changes I made are I updated my SIP sorcery library from 6.2.0 to 8.0.0 and added local ICE candidate in web side too. Now in my index.js the
I'm not sure if the issue is solved by adding local ice candidate or by updating the SIP sorcery library, But I did both and it works fine. Thank you @sipsorcery . |
Beta Was this translation helpful? Give feedback.
Hi, I was busy elsewhere and now I started working with WebRTC once again after a while. First I reviewed my code and found out that I am adding local ice candidate in my PC in desktop side but not doing that in my web (index.js). So I tried it it and I think that was the issue. Now my stream is connecting over different networks (even on networks with firewalls).
The major changes I made are I updated my SIP sorcery library from 6.2.0 to 8.0.0 and added local ICE candidate in web side too.
Now in my index.js the
pc.onicecandidate
is something like this: