PROTOTYPE IMPLEMENTATION OF THE PROPOSED WEBSOCKET 09 DRAFT SPECIFICATION
draft-ietf-hybi-thewebsocketprotocol-09

 

INTRODUCTION

 

This package is part of the HTML5 Labs sandbox that gives you implementation experience with draft specifications, helps enable faster iterations around Web specifications without getting locked in too early with a specific draft, and gives you the opportunity to provide feedback to improve the specification.

 

Read more about this prototype and leave your feedback at http://blogs.msdn.com/b/interoperability/archive/2011/06/23/websockets-prototype-gets-another-update.aspx.

 

The WebSocket draft specification implemented by this prototype is available at http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-09.

 

 

PACKAGE CONTENTS

 

This package contains the following components:

1.       A Windows Communication Foundation (WCF) 4.0 server side binding implementation of the WebSocket specification draft at http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-05.

2.       Server side WCF 4.0 programming model for WebSockets.

3.       Silverlight 4 client side implementation of the protocol.

4.       .NET 4.0 client side implementation of the protocol.

5.       A HTML bridge from the Silverlight to JavaScript that enables use of the prototype from JavaScript applications running in browsers that support Silverlight.

6.       Web chat stock quote and Game samples.

 

PROTOTYPE LIMITATIONS

 

The prototype implementation has the following limitations:

1.       A Silverlight client (and a JavaScript client, via the HTML bridge) can only communicate using the proposed WebSocket protocol using ports in the range 4502-4534 (this is related to network security access restrictions applied to all direct use of sockets in the Silverlight platform).

3.       There is no support for web proxies in the client implementation.

4.       There is no support for SSL.

5.       Server side implementation limits the number of concurrent WebSocket connections to 5.

 

 

USING THE LIBRARIES

 

In order to provide early implementation experience for the WebSockets protocol, this package includes the following components in the %ProgramFiles%\Microsoft SDKs\WCF WebSockets\11.05.11\bin directory that can be used to experiment with prototype applications:

1.       Microsoft.ServiceModel.WebSockets.dll - a .NET 4.0 library implementing the WCF server side binding for the WebSocket protocol.

2.       Microsoft.ServiceModel.WebSockets.Silverlight.dll - a Silverlight 4 library implementing the Silverlight client for the protocol.

3.       Microsoft.ServiceModel.WebSockets.DesktopClient.dll - a .NET 4.0 library implementing the .NET 4.0 client for the protocol. Silverlight and .NET APIs are almost identical.

4.       Microsoft.ServiceModel.WebSockets.xap and jquery.slws.js - a Silverlight 4 application and a jQuery plugin that enables Ajax/JavaScript browser application to use the Silverlight WebSocket functionality from JavaScript code through an HTML bridge. The jquery.slws.js file is included in the %ProgramFiles%\Microsoft SDKs\WCF WebSockets\11.05.11\web\chat\js directory.

5.       clientaccesspolicy.xml - a Silverlight cross-domain policy file that must be exposed over HTTP at the root of the domain where a WCF WebSocket service is running to enable Silverlight clients to communicate with it.

6. The 07 Implementation include support for Nagle. The samples include a jscript file jquery.slws.js that wraps the Silverlight WebSocket implementation. In the jquery.slws.js file the following lines of code can be used to enable/disable Nagle:

                this.slws = slCtl.Content.services.createObject("websocket");

this.slws.NoDelay = true;           //  <-- Insert this line to disable Nagle