Can you get encrypted bidirectional communication using WCF where the client can be behind a proxy, firewall, or NAT?

I have a client and a server written in .net 3.5 so I have no compatibility issues.

The server is fully reachable on port 443 (I host it to open other ports as needed)

The client, however, is less accessible. This is often behind a corporate firewall or NAT, or uses an http / https proxy to connect to the internet.

I need to establish an encrypted bi-directional communication between client and server.

The two bidirectional pipes provided in WCF don't seem to do the trick:

  • NetTcpBinding does not support HTTP proxy ( source )

  • WSDualHttpBinding requires the client to have a public URI that provides a callback endpoint for the service, which is unfortunately not here ( source )

Can WCF establish this encrypted bidirectional connection (silently using https tuning if necessary) without having to configure the client side firewall / proxy settings?

+1


source to share


6 answers


You are looking for a technology called Comet. Wikipedia entry If you google comet wcf, you will find articles that should point you in the right direction.



+1


source


Yes. You can use WSDualHttpBinding or NetTcpBinding.



0


source


A sane firewall should allow this behavior. Because communication is client initiated, the stateful firewall allows the communication channel to remain open, but only between two well-known endpoints.

0


source


I found some interesting information here

Basically, you can edit your app.config file like this:

<system.net>
   <defaultProxy useDefaultCredentials="true">
      <proxy bypassonlocal="False" proxyaddress="http://gateway:8080" />
   </defaultProxy>
</system.net> 

      

I'm not sure if it works for NetTcpBinding, although the article claims it works for custom bindings. I'll try and let you know what happened.

UPDATE: it doesn't work (default config only works for http and https requests)

0


source


I have a similar need and saw this article about the Comet-esque feature they provided for Silverlight 2 over WCF: Silverlight Polling Duplex .

I haven't tried it yet, but I think that an assembly built against the desktop runtime might also include client classes, if that might be useful outside of Silverlight.

Edit: I've checked both assemblies and they both implement the same Bindings and Channels, it looks like the exact same code that was just generated against desktop frames; therefore, you can use the Server assembly in a desktop application.

0


source


According to this answer , I got a similar question: .NET v4 works across NAT with the WSDualHttpBinding class. Your question was asked a couple of years ago, so it wasn't for you then ...

0


source







All Articles