Monday, 25 April 2011

WebSockets MIX 11 Demo

Update: HTML5 labs has released a new version of the prototype based on version 07 of the WebSocket protocol. I've updated my demo to use this version, and I've tested successfully against a nightly build of firefox that also supports 07 (see link below).

I've had some requests for the source code for the tiny WebSockets demo I did at MIX. I’ve put the code up on github:

(You don’t need to use git to grab this, just click the download link.)

I don’t have a license to redistribute the two binaries that I reference: Microsoft.ServiceModel.Tcp.dll Microsoft.ServiceModel.WebSockets.dll

But these are included in the HTML5 Labs WebSocket prototype, which is here:

Once the install is complete, you'll have the prototype bits at: C:\Program Files (x86)\Microsoft SDKs\WCF WebSockets or C:\Program Files\Microsoft SDKs\WCF WebSockets if you are on a 32-bit OS.

If you are going to use the Silverlight plugin to simulate WebSockets, you'll need to drop the clientaccesspolicy.xml file (found in the bin folder) into your c:\inetpub\wwwroot folder.

If you want to use the private build of Firefox with support for 07 WebSockets, you can get this here:

Finally, you can follow along with the MIX video:

1 comment:

  1. I'm halfway thru your MIX 11 demo and have just finished downloading the HTML5 WebSockets prototype you listed. It doesn't look as though any of the WebSockets WCF services are hosted within a ASP.NET site. Is it possible to do so? If not, are there plans to be able to host a WebSockets service from within a ASP.NET web project?