3

I would like to play with the new Web Socket support in Chrome (and soon Firefox), but have been unable to find a WCF implementation that will act as the server.

Have somebody implemented a .net WCF Web Socket based server?

Egil Hansen
  • 15,028
  • 8
  • 37
  • 54
  • I wrote the same (almost) question a few days ago: http://stackoverflow.com/questions/2064641/is-there-a-websocket-client-implemented-for-net – Jonas Jan 19 '10 at 23:10
  • Sanoj: I did see your question, but as I read it you are asking for a client implementation, which I am not. I am asking for a server side implementation. – Egil Hansen Jan 25 '10 at 15:10

3 Answers3

2

The Web Socket protocol specification is so simple that you could implement a server to play with in a couple of hours. Assuming that you already have a TCP server component, it's just a matter of implementing the handshake (respond to a client request) and then receiving or sending data frames over TCP.

I used Delphi to implement the protocol and a chat server/client example; you can get the source code here. It shouldn't be very hard to translate it to .NET.

Tihauan
  • 2,780
  • 2
  • 26
  • 29
  • Great, thanks for the suggestion. I was actually considering just implementing it myself, but I try my best not to redo work already done. From the looks of it, I may have to actually do the work myself this time :) – Egil Hansen Jan 25 '10 at 15:13
1

Recently the Interoperability Bridges and Labs Center released a prototype implementation (in managed code) of two drafts of the WebSockets protocol specification:

draft-hixie-thewebsocketprotocol-75 and draft-hixie-thewebsocketprotocol-76

The prototype can be found at HTML5 Labs. I put in this blog post all the information I found (until now) and snippets of code about how this can be done using WCF.

Nikos Baxevanis
  • 10,868
  • 2
  • 46
  • 80
0

If you are still looking for a solution you may try this.

http://www.codeproject.com/KB/WCF/WCFWebApp.aspx

harsha
  • 933
  • 1
  • 12
  • 26