SOCKS communication using .net framework 4.0 - c#

I want to communicate with server to run my c# application and so I need to connect with server through sock communication. Is it possible using .net framework 4 ?

Socks and Sockets are different ..
Indeed if you wish to use sockets you could use System.Net.Sockets but,
if you wish to use SOCKS (SOCKS client/server that can be used to provide convenient and secure network connectivity) you could use next example http://www.cknotes.com/?p=204

You could use the System.Net.Sockets class to connect to port on a remote server.
If you are looking for SOCKS C# libs you could go for these which works with HTTP, Socks4, Socks4a, and Socks5 proxy servers and comes with integrated help. It also works with Mono.
http://www.starksoft.com/prod_proxy.html
http://sourceforge.net/projects/starksoftproxyc/

Was looking for same thing and ran across this: Socks4/5 proxy in .net
It isn't .net 4.0 but it is a good jumping off point.1

Related

Using WebSockets to communicate between Java and C# desktop applications?

I am interested in deploying a server to GoDaddy as a C# web application, then have desktop clients developed in C# and Java be able to subscribe/publish to the server using WebSockets (RFC 6455).
WebSocket supported libraries I am looking at are XSockets.Net and SignalR.
I am not able to find anything on using XSockets.Net (not to be confused with XSocket.org) in Java. I understand that XSockets targets MS .Net framework and Mono environments. However, looking at SignalR, there is also SignalA which is a Java based SignalR client for Android.
Thinking-out-loud... I understand there are many WebSocket libraries for Java, which suggests the idea that if I am able to publish a message (using WebSocket) from a Java application to a server, then I should be able to read it and processes it in C#, since WebSocket protocol is a standard.
Thus far, I believe a SignalR solution will satisfy my requirement to allow C# & Java applications to talk on the Web, but due to transport requirments of SignalR, my communication will not utilize WebSockets. Reading through SignalR requirements, to get WebSockets transport activated I must use Windows8+ with .Net Framework for 4.5+. GoDaddy does not use Windows8 for windows hosting, and even if it did, then all my clients must also use Windows8, which is not a guarentee.
So the question is: How can I get C# & Java desktop clients to talk on the web via WebSockets, othan than using SignalR and XSockets.Net?
Any help is very much appreciated!
EDIT: I will now look into deploying a C# XSockets.NET Server and have a C# XSockets.NET client and a Java JWebSocket client since both JWebSockets and XSockets support the WebSocket RFC6455 protocol. I will post my findings here and close this question if that was a successful effort.
You can implement a RFC6455 client in any language and use XSockets. However do note that XSockets uses a publish/subscribe pattern that you will have to implement as well to take benefit of the platform.
The upside is that you actually wont have to implement RFC6455 since you can implement a custom (non websocket protocol) and use that when communicating from desktop (or anything else). Since everything in XSockets is a plugin you can add custom protocols and still communicate with client talking RFC6455 since XSockets will offer cross-protocol communication.
So the thing you have to implement is actually only the publish/subscribe functionality in the java client.
There are probably not any Java clients out there that implements the IXSocketClient interface today, and we focused on Mono instead of Java when covering multi-platform support.
We will help you out in any way we can if you decide to write your own java implementation.
Note: as of the next version (not far away) it will be very easy to implement your custom protocol and connect from any device talking TCP/IP
In my humble opinion, you have misunderstood some things.
XSockets and SignalR are libraries which are totally oriented to a specific platform, .NET. They both wrap the functionality of WebSockets, a platform independent standard, to ease its use. This does not by anyway mean that you could use XSocket, or SignalR libraries in all platforms.
I suppose that creating a java client for XSockets or SignalR would be an overkill and would lead you to heavily depend on a 3rd party library. In your situation, I would go on with using WebSockets directly on my server side. Then I would use a library handling the WebSockets standard for each client, which could be different for each client development platform. Therefore, you would depend on one universal standard and you would minimize dependencies on 3rd party libraries.
Hope I helped!

What is the best way to communicate between a node.js server and a C# client?

I have a server running on node.js, using socket.io and HTML5 clients.
I also have a more specific client written in C#, because it's running on Microsoft's PixelSense.
My primary idea was to use C# socket.io implementations, but i didn't found one of these working implementation :(
But, the good point is that the node.js is running on the pixelsense device. I can use more rustic solutions like file's pipes.
In your opinion, what is the best way to communicate between my node server and my C# client running on the same machine (windows) ?
Do you know a working implementation of socket.io in C# ? A small hack using files ? A use of a intermediate server ?
Performances and reactivity are a plus.
Thanks
What's the reason of socket.io usage? I think it's definitely better to use TCP Sockets for communication between this platforms. This way you can easy add SSL support and don't think about compatibility.

Looking for a specific type of tcp server

I'm looking for a c# tpc server, or a tcp server that has c# interface, that supports authentication from client to server, maybe via username/passwords or certificates, supports ssl/tls for transport and generally supports incoming channel to forward messages to server and outgoing command channel to send commands to event forwarder, like change this, and perhaps works on Mono as well as Windows, and is performant, i.e. can support multiple (dozens to hundreds of clients), as well as Windows IOCP.
I did look at WCF, but it's too vast/heavy for my requirements.
Thanks.
regards
Bob.
IIS seems like the obvious choice.
Found the following which can be called from c#. Its a high performance Windows IOCP based TCP Server.
http://code.google.com/p/potatofoundation/

Use security in tcp connection

I need to connect a remote server using TCP. the connection need to be secure (SSL/TLS).
The question is how can I open a secure connection to the server?
Does .net framework have the ability?
(I am using c#)
Thank you,
Alon,
SslStream class in .NET framework, or our SSL components if you need advanced functionality and complete control.
The most common and probably one of the best libraries is OpenSSL
UPDATE
.NET wrapper for OpenSSL library

Simple client / server concept for .NET

I want to implement a simple cardgame in silverlight that can be played together via a server.
My question is, what concept for communication between client and server I should use.
Is it possible to use WCF to
implement the server ? I guess no because its more like a dataprovider right ?
or do I need to use .NET Remoting ? Haven't read much about it yet, but
I'm not quite sure if it is maybe out
of date ?
Maybe there are newer approaches that I don't know yet ?
Maybe someone has a good tutorial link for the beginning that is not a bad coded sample from year 2002
WCF and .NET Remoting define communication protocols, that is, they define the plumbing between client and server.
When writing a client/server application, you should use WCF as .NET Remoting is deprecated.
See this code project article and code for a simple client/server implementation using WCF. The code is for uni-directional communication, where the server responds to the client.
Here is another article, with a more complicated sample (chat client), using bi-directional communications between client(s) and server. It also uses WPF as the UI layer, so you may need to read around that if using winforms.
WCF (Windows Communication Foundation) is the .NET technology for communication. It includes simple client / server scenarios, as well as publish / subscribe and peer to peer.
Ignore .NET Remoting. It has been replaced by WCF.
I have no idea why you thought that WCF was a data provider, but you're mistaken. See the WCF Developers Center for more on WCF.

Categories