0

Since a few weeks I am desperately trying to create an application that can transfer data in a peer to peer network, among other things.

After trying multiple libraries (as mentioned below) I never had any success. There were either problems with the connection itself, or I could not implement NAT-Traversal or UDP Hole Punching in any way.

Which leads to my main question: Is there an easy and modern way of using C# for Peer-to-Peer communication that can be used internet-wide without port forwarding? Does anyone have any experience with that?

All I need is to transfer a byte array or string value. I'd be very happy if someone could help me out.

I've tried several WebRTC-Libraries for C# .NET 6.0 including SIPSorcery and microsoft.mixedreality.webrtc. Also, I've tried the WebRTC NuGet-Package which isn't compatible with .NET 6.0. Besides that, I tried some things with TcpListeners and WebSockets but I just couldn't find out how to connect peers over the internet.

D1i2m3
  • 3
  • 3
  • The easiest way is an REST API using ASP.NET Core. – Magnetron Apr 05 '23 at 19:53
  • Yeah, but if you dont host the REST API on a public server you can't use it internet-wide. I need an application that's independent of any infrastructure so this solution isn't gonna work for me :/ – D1i2m3 Apr 06 '23 at 04:32
  • You can use internet wide, you just need the other end IP address and that the ports you're using are open in your router and firewall. – Magnetron Apr 06 '23 at 11:27
  • I know, but that's the problem here. Since there is a thing called NAT, this isn't that easy. – D1i2m3 Apr 06 '23 at 15:26

0 Answers0