WebRTC STUN and TURN servers in C# - c#

My question today is how to develop stun and turn servers for webrtc peer-to-peer application in c# is there any library supports this, I can't find any example or resource to obtain this.
Please help me with this because it took me too much time searching with no luck.
I tried OfficeSip and didn't work also I tried coturn over cygwin but didn't work.

I'm not sure if there's any STUN/TURN server or library implemented in C#.
The ones that I know of are
coturn
PJNATH
STUNTMAN
go-stun
ReTurn
turnover
On the coturn page you can see a list of all the RFC that has to be implemented.
Frankly, I would not commit to such a huge task of implementing a TURN/STUN server. If you need one that works in Windows, and none of these work, you can try to run it in a VM or something like Docker.

Related

.Net Memcache with Touch and GetAndTouch Implementation

I am currently looking into using memcache on my windows azure application, but am running into the following situation:
I have looked around for a client/server implementation of memcache for my C# for my application, and have found some really good ones! I have looked at Enyims, BeIT, memchachedotnet, and couchbase's.
However, the first three all dont have the Touch and GetAndTouch client methods, and the last one requires server installation (of which I am trying to avoid).
Are they any .net Implementations out there that do implement this? Or maybe someone has built one of their own?! :P
Thanks!

.NET: List HTTP traffic URLs with C#

I am looking for a basic method of retrieving the URLs (HTTP) being requested by any other application on the local computer. Basically I only want a textbox in this app that lists the URLs as they are being requested. I am only interested in the url, nothing more. What would be the simplest way of accomplishing this? I would rather not require the app to run in admin-mode and I don't want to use external libraries such as Fiddler or similar.
Update:
I noticed Fiddler was developed with .NET so its obviously possible to do what I want using only .NET. Im sifting through the code of Fiddler using Reflector but its not giving me much. I dont know where to start. But as I said, Im only interesting in outgoing traffic on HTTP and only the specific url of the request. This cant be so hard so fix with .NET only?
Update:
The key seem to be to use a Socket from the System.Net.Sockets namespace. Im not exactly sure how to use it correctly yet but Im following some other examples and it seem to be pretty easy.
I know you said don't want to use external libraries, but there is no simple way of intercepting the URLs requested by other processes without using other libraries.
In case you are interested, I used PCap .NET some time ago. It was really easy to use, and in few hours I had an application listening for HTTP communications between third party applications, and automating one of them depending on the captured info.

monitor internet usage in .net

I want to write a method in C# to check which applications in my machine/server are using internet connection at a particular point in time and if possible, how much bandwidth they are using. Can anyone please help me get a head start on this?
I decided to write an answer because comments are too small.
Well, reading other Q&A on stackoverflow and looking around on the internet, I didn't find a simple solution for your problem.
Actually, for .NET processes is really simple, you just need to retrieve informations from ".NET CLR Networking - Bytes Received/Bytes Sent" performance counters, as shown in this Q&A
But in general, getting per-process used bandwidth isn't an easy work.
For example "Microsoft Network Monitor" sniffer can trace the process that generates internet packets only for TCP traffic, because probably it maps IP-port pairs with processes using them (or something similar, TCP is a connected protocol so it is simpler).
Anyway if you want to give it a try you can use the exposed API (look at this blog entry for some hint).
However, as suggested in these Q&A's (LINK 1, LINK 2), the right, and probably the only way, is to write a NDIS/TDI driver that can intercept network traffic and exposing a .NET callable API to it.
The problem is that such drivers can't be written in managed code, and so you need to implement it in C/C++.
Obviously, if you manage to find an already written driver/sniffer exposing a callable API, you can use it.
For example WinPCap has one (and some .NET wrappers like SharpPCap or PCap.Net), but I don't think (not sure) it's able to get packets's source-process information.
As digEmAll noted, in pre-Vista Windows you are reduced to writing your own driver or using a 3-rd party one. In Vista, 2008 and Windows 7 you can use the GetPerTcpConnectionEStats API (there is a large example of its usage on the MSDN page). Resource Monitor relies on this API, together with the older GetTcpTable/GetTcpRow APIs, for extended network statistics.
I found Process Monitor as a very useful tool and it served my purpose so I didnt had to write any code although i am yet to check out whether it gives any API which i can use in my application to get some information I need.
Thanks everyone for helping me out.

C# port forwarding

I'm developing a simple p2p program that is meant to work over the Internet, this works fine on a LAN, but when a router and internet connection are involved nothing gets to the machine. I am aware that this is a network question more than a C# question, but I can't have users of this program set up port forwarding every time they want to use the software. I have read the other posts regarding this, but most seem old, so I was wondering if VS2010 has any way to tackle this.
Note: The code for the networking is already complete, and uses TCPLsteners and Clients, so I can't switch to any other method...
Thanks,
PM
Is there a UPnP Library for .NET (C# or VB.NET)? looks promising...

VT100 Emulation LIbrary in C# with SharpSSH

I'm messing around with Tamir.SharpSsh and wanted to see if it was possible to use it to implement a console SSH client fully in C#. I do not mean something like putty where it's actually running in it's own GUI, but something you could run directly from the windows cmd console.
The library is pretty great, except that it doesn't handle terminal emulation in any way. So when using SshShell, you can do some basic interaction, but the output is often very ugly and full of random characters and you cannot actually interact with things like shell scripts, etc.
As far as I can tell SharpSSH simply redirects the IO to the console IO.
How hard would it be to redirect this elsewhere and handle the terminal emulation? Also, is there an emulation library (C# and open source, preferably) already that I could use?
Edit: Gave up on SharpSSH, see answer below for the final solution I came up with.
I have actually since abandoned trying to use SharpSSH. It is a good library, but was just too lacking in overall functionality. I am now using a library called Granados which is a much more fleshed out SSH implementation. It has a built in event model (unlike SharpSSH which mostly involves wrangling with Streams) that makes usage very easy.
As for the terminal emulation part... Granados is actually the core of another open source project called Poderosa.
Poderosa is a complete terminal emulator application that can connect to ssh, telnet and even your local cygwin install.
I haven't really dove into it's terminal emulation code at all, but it definitely does it quite well, so I'm sure you could easily pull out whatever code you need.
I'm looking for the same thing. There is a library here that costs $700. Found another one on codeproject that looks shoddy but might be a good start. And there is an incomplete implementation right here on stackoverflow. Still searching..

Categories

Resources